diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d3683d7..e07d2aa6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9.4) +cmake_minimum_required(VERSION 3.15) # minimum version required by QuaZip if(WIN32) # In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows @@ -43,6 +43,8 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror=return-type") # Fix build with Qt 5.13 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_DEPRECATED_WARNINGS=Y") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_DISABLE_DEPRECATED_BEFORE=0x050C00") + option(ENABLE_LTO "Enable Link Time Optimization" off) if(ENABLE_LTO) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index afb33a50..dc8a7b0d 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -223,9 +223,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) setApplicationName(BuildConfig.LAUNCHER_NAME); setApplicationDisplayName(BuildConfig.LAUNCHER_DISPLAYNAME); setApplicationVersion(BuildConfig.printableVersionString()); - #if (QT_VERSION >= QT_VERSION_CHECK(5,7,0)) - setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME); - #endif + setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME); startTime = QDateTime::currentDateTime(); // Don't quit on hiding the last window diff --git a/launcher/UpdateController.cpp b/launcher/UpdateController.cpp index c02cd1e7..646f8e57 100644 --- a/launcher/UpdateController.cpp +++ b/launcher/UpdateController.cpp @@ -138,20 +138,6 @@ void UpdateController::installUpdates() } #endif QFileInfo destination (FS::PathCombine(m_root, op.destination)); -#ifdef Q_OS_WIN32 - if(QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) - { - if(destination.fileName() == windowsExeName) - { - QDir rootDir(m_root); - exeOrigin = rootDir.relativeFilePath(op.source); - exePath = rootDir.relativeFilePath(op.destination); - exeBackup = rootDir.relativeFilePath(FS::PathCombine(backupPath, destination.fileName())); - useXPHack = true; - continue; - } - } -#endif if(destination.exists()) { QString backupName = op.destination; diff --git a/launcher/main.cpp b/launcher/main.cpp index 275fff32..85c5fdee 100644 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -24,10 +24,8 @@ int main(int argc, char *argv[]) return 42; #endif -#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)) QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); diff --git a/launcher/ui/dialogs/ExportInstanceDialog.cpp b/launcher/ui/dialogs/ExportInstanceDialog.cpp index 5fac1015..8631edf6 100644 --- a/launcher/ui/dialogs/ExportInstanceDialog.cpp +++ b/launcher/ui/dialogs/ExportInstanceDialog.cpp @@ -117,7 +117,7 @@ public: flags |= Qt::ItemIsUserCheckable; if (sourceIndex.model()->hasChildren(sourceIndex)) { - flags |= Qt::ItemIsTristate; + flags |= Qt::ItemIsAutoTristate; } } @@ -210,7 +210,7 @@ public: QStack todo; while (1) { - auto node = doing.child(row, 0); + auto node = fsm->index(row, 0, doing); if (!node.isValid()) { if (!todo.size()) @@ -259,7 +259,7 @@ public: QStack todo; while (1) { - auto node = doing.child(row, 0); + auto node = this->index(row, 0, doing); if (!node.isValid()) { if (!todo.size()) @@ -460,7 +460,7 @@ void ExportInstanceDialog::rowsInserted(QModelIndex parent, int top, int bottom) //WARNING: possible off-by-one? for(int i = top; i < bottom; i++) { - auto node = parent.child(i, 0); + auto node = proxyModel->index(i, 0, parent); if(proxyModel->shouldExpand(node)) { auto expNode = node.parent(); diff --git a/launcher/ui/pages/global/ExternalToolsPage.cpp b/launcher/ui/pages/global/ExternalToolsPage.cpp index 693ca5c1..5ba0ebc2 100644 --- a/launcher/ui/pages/global/ExternalToolsPage.cpp +++ b/launcher/ui/pages/global/ExternalToolsPage.cpp @@ -54,9 +54,7 @@ ExternalToolsPage::ExternalToolsPage(QWidget *parent) : ui->setupUi(this); ui->tabWidget->tabBar()->hide(); - #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) ui->jsonEditorTextBox->setClearButtonEnabled(true); - #endif ui->mceditLink->setOpenExternalLinks(true); ui->jvisualvmLink->setOpenExternalLinks(true);