Skip to content

Commit 359c55f

Browse files
authored
Merge branch 'PrismLauncher:release-8.x' into release-8.x
2 parents 7787e35 + a58f7bf commit 359c55f

58 files changed

Lines changed: 561 additions & 190 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRIN
179179

180180
######## Set version numbers ########
181181
set(Launcher_VERSION_MAJOR 8)
182-
set(Launcher_VERSION_MINOR 3)
182+
set(Launcher_VERSION_MINOR 4)
183183

184184
set(Launcher_VERSION_NAME "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}")
185185
set(Launcher_VERSION_NAME4 "${Launcher_VERSION_MAJOR}.${Launcher_VERSION_MINOR}.0.0")

buildconfig/BuildConfig.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ class Config {
163163

164164
QString RESOURCE_BASE = "https://resources.download.minecraft.net/";
165165
QString LIBRARY_BASE = "https://libraries.minecraft.net/";
166-
QString AUTH_BASE = "https://authserver.mojang.com/";
167166
QString IMGUR_BASE_URL = "https://api.imgur.com/3/";
168167
QString FMLLIBS_BASE_URL = "https://files.prismlauncher.org/fmllibs/"; // FIXME: move into CMakeLists
169168
QString TRANSLATIONS_BASE_URL = "https://i18n.prismlauncher.org/"; // FIXME: move into CMakeLists

cmake/MacOSXBundleInfo.plist.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<string>A Minecraft mod wants to access your camera.</string>
77
<key>NSMicrophoneUsageDescription</key>
88
<string>A Minecraft mod wants to access your microphone.</string>
9+
<key>NSDownloadsFolderUsageDescription</key>
10+
<string>Prism uses access to your Downloads folder to help you more quickly add mods that can't be automatically downloaded to your instance. You can change where Prism scans for downloaded mods in Settings or the prompt that appears.</string>
911
<key>NSPrincipalClass</key>
1012
<string>NSApplication</string>
1113
<key>NSHighResolutionCapable</key>

flatpak/org.prismlauncher.PrismLauncher.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ modules:
6262
config-opts:
6363
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
6464
- -DBUILD_SHARED_LIBS:BOOL=ON
65-
- -DGLFW_USE_WAYLAND=ON
65+
- -DGLFW_USE_WAYLAND:BOOL=ON
66+
- -DGLFW_BUILD_DOCS:BOOL=OFF
6667
sources:
6768
- type: git
6869
url: https://github.com/glfw/glfw.git

launcher/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@ SET(LAUNCHER_SOURCES
827827
ui/themes/DarkTheme.h
828828
ui/themes/ITheme.cpp
829829
ui/themes/ITheme.h
830+
ui/themes/HintOverrideProxyStyle.cpp
831+
ui/themes/HintOverrideProxyStyle.h
830832
ui/themes/SystemTheme.cpp
831833
ui/themes/SystemTheme.h
832834
ui/themes/IconTheme.cpp

launcher/FileSystem.cpp

Lines changed: 51 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -801,25 +801,68 @@ QString NormalizePath(QString path)
801801
}
802802
}
803803

804-
static const QString BAD_PATH_CHARS = "\"?<>:;*|!+\r\n";
805-
static const QString BAD_FILENAME_CHARS = BAD_PATH_CHARS + "\\/";
804+
static const QString BAD_WIN_CHARS = "<>:\"|?*\r\n";
805+
static const QString BAD_NTFS_CHARS = "<>:\"|?*";
806+
static const QString BAD_HFS_CHARS = ":";
807+
808+
static const QString BAD_FILENAME_CHARS = BAD_WIN_CHARS + "\\/";
806809

807810
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
808811
{
809812
for (int i = 0; i < string.length(); i++)
810813
if (string.at(i) < ' ' || BAD_FILENAME_CHARS.contains(string.at(i)))
811814
string[i] = replaceWith;
812-
813815
return string;
814816
}
815817

816-
QString RemoveInvalidPathChars(QString string, QChar replaceWith)
818+
QString RemoveInvalidPathChars(QString path, QChar replaceWith)
817819
{
818-
for (int i = 0; i < string.length(); i++)
819-
if (string.at(i) < ' ' || BAD_PATH_CHARS.contains(string.at(i)))
820-
string[i] = replaceWith;
820+
QString invalidChars;
821+
#ifdef Q_OS_WIN
822+
invalidChars = BAD_WIN_CHARS;
823+
#endif
821824

822-
return string;
825+
// the null character is ignored in this check as it was not a problem until now
826+
switch (statFS(path).fsType) {
827+
case FilesystemType::FAT: // similar to NTFS
828+
/* fallthrough */
829+
case FilesystemType::NTFS:
830+
/* fallthrough */
831+
case FilesystemType::REFS: // similar to NTFS(should be available only on windows)
832+
invalidChars += BAD_NTFS_CHARS;
833+
break;
834+
// case FilesystemType::EXT:
835+
// case FilesystemType::EXT_2_OLD:
836+
// case FilesystemType::EXT_2_3_4:
837+
// case FilesystemType::XFS:
838+
// case FilesystemType::BTRFS:
839+
// case FilesystemType::NFS:
840+
// case FilesystemType::ZFS:
841+
case FilesystemType::APFS:
842+
/* fallthrough */
843+
case FilesystemType::HFS:
844+
/* fallthrough */
845+
case FilesystemType::HFSPLUS:
846+
/* fallthrough */
847+
case FilesystemType::HFSX:
848+
invalidChars += BAD_HFS_CHARS;
849+
break;
850+
// case FilesystemType::FUSEBLK:
851+
// case FilesystemType::F2FS:
852+
// case FilesystemType::UNKNOWN:
853+
default:
854+
break;
855+
}
856+
857+
if (invalidChars.size() != 0) {
858+
for (int i = 0; i < path.length(); i++) {
859+
if (path.at(i) < ' ' || invalidChars.contains(path.at(i))) {
860+
path[i] = replaceWith;
861+
}
862+
}
863+
}
864+
865+
return path;
823866
}
824867

825868
QString DirNameFromString(QString string, QString inDir)

launcher/FileSystem.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ enum class FilesystemType {
378378
HFSX,
379379
FUSEBLK,
380380
F2FS,
381+
BCACHEFS,
381382
UNKNOWN
382383
};
383384

@@ -406,6 +407,7 @@ static const QMap<FilesystemType, QStringList> s_filesystem_type_names = { { Fil
406407
{ FilesystemType::HFSX, { "HFSX" } },
407408
{ FilesystemType::FUSEBLK, { "FUSEBLK" } },
408409
{ FilesystemType::F2FS, { "F2FS" } },
410+
{ FilesystemType::BCACHEFS, { "BCACHEFS" } },
409411
{ FilesystemType::UNKNOWN, { "UNKNOWN" } } };
410412

411413
/**
@@ -458,7 +460,7 @@ QString nearestExistentAncestor(const QString& path);
458460
FilesystemInfo statFS(const QString& path);
459461

460462
static const QList<FilesystemType> s_clone_filesystems = { FilesystemType::BTRFS, FilesystemType::APFS, FilesystemType::ZFS,
461-
FilesystemType::XFS, FilesystemType::REFS };
463+
FilesystemType::XFS, FilesystemType::REFS, FilesystemType::BCACHEFS };
462464

463465
/**
464466
* @brief if the Filesystem is reflink/clone capable

launcher/LaunchController.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void LaunchController::launchInstance()
316316
online_mode = "online";
317317

318318
// Prepend Server Status
319-
QStringList servers = { "authserver.mojang.com", "session.minecraft.net", "textures.minecraft.net", "api.mojang.com" };
319+
QStringList servers = { "login.microsoftonline.com", "session.minecraft.net", "textures.minecraft.net", "api.mojang.com" };
320320
QString resolved_servers = "";
321321
QHostInfo host_info;
322322

launcher/MMCZip.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@ std::optional<QStringList> extractSubDir(QuaZip* zip, const QString& subdir, con
288288

289289
do {
290290
QString file_name = zip->getCurrentFileName();
291-
#ifdef Q_OS_WIN
292291
file_name = FS::RemoveInvalidPathChars(file_name);
293-
#endif
294292
if (!file_name.startsWith(subdir))
295293
continue;
296294

launcher/MMCZip.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ bool collectFileListRecursively(const QString& rootDir, const QString& subDir, Q
154154
#if defined(LAUNCHER_APPLICATION)
155155
class ExportToZipTask : public Task {
156156
public:
157-
ExportToZipTask(QString outputPath, QDir dir, QFileInfoList files, QString destinationPrefix = "", bool followSymlinks = false)
157+
ExportToZipTask(QString outputPath,
158+
QDir dir,
159+
QFileInfoList files,
160+
QString destinationPrefix = "",
161+
bool followSymlinks = false,
162+
bool utf8Enabled = false)
158163
: m_output_path(outputPath)
159164
, m_output(outputPath)
160165
, m_dir(dir)
@@ -163,10 +168,15 @@ class ExportToZipTask : public Task {
163168
, m_follow_symlinks(followSymlinks)
164169
{
165170
setAbortable(true);
166-
m_output.setUtf8Enabled(true);
171+
m_output.setUtf8Enabled(utf8Enabled);
167172
};
168-
ExportToZipTask(QString outputPath, QString dir, QFileInfoList files, QString destinationPrefix = "", bool followSymlinks = false)
169-
: ExportToZipTask(outputPath, QDir(dir), files, destinationPrefix, followSymlinks){};
173+
ExportToZipTask(QString outputPath,
174+
QString dir,
175+
QFileInfoList files,
176+
QString destinationPrefix = "",
177+
bool followSymlinks = false,
178+
bool utf8Enabled = false)
179+
: ExportToZipTask(outputPath, QDir(dir), files, destinationPrefix, followSymlinks, utf8Enabled){};
170180

171181
virtual ~ExportToZipTask() = default;
172182

0 commit comments

Comments
 (0)