Skip to content

Commit

Permalink
Qt: Manually split filename to avoid overzealous splitting (fixes #2681)
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Oct 15, 2022
1 parent 5067eb6 commit d5669c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
@@ -1,5 +1,6 @@
0.11.0: (Future)
Other fixes:
- Qt: Manually split filename to avoid overzealous splitting (fixes mgba.io/i/2681)
- Res: Fix species name location in Ruby/Sapphire revs 1/2 (fixes mgba.io/i/2685)

0.10.0: (2022-10-11)
Expand Down
10 changes: 9 additions & 1 deletion src/platform/qt/ApplicationUpdater.cpp
Expand Up @@ -137,7 +137,15 @@ QUrl ApplicationUpdater::parseManifest(const QByteArray& manifest) {
QString ApplicationUpdater::destination() const {
QFileInfo path(updateInfo().url.path());
QDir dir(ConfigController::configDir());
return dir.filePath(QLatin1String("update.") + path.completeSuffix());
// QFileInfo::completeSuffix will eat all .'s in the filename...including
// ones in the version string, turning mGBA-1.0.0-win32.7z into
// 0.0-win32.7z instead of the intended .7z
// As a result, so we have to split out the complete suffix manually.
QString suffix(path.suffix());
if (path.completeBaseName().endsWith(".tar")) {
suffix = "tar." + suffix;
}
return dir.filePath(QLatin1String("update.") + suffix);
}

const char* ApplicationUpdater::platform() {
Expand Down

0 comments on commit d5669c2

Please sign in to comment.