From 44a31910e3fbb6662215322719ffb050e1d2ccbc Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:23:41 +0200 Subject: [PATCH] inverse flag; simplify --- CMakeLists.txt | 4 ---- launcher/CMakeLists.txt | 1 + launcher/firstLaunch/firstlaunch_moc.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c7f54c11..1829a7c22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,10 +193,6 @@ else() endmacro(enable_pch) endif() -if(NOT ENABLE_INNOEXTRACT) - add_definitions(-DVCMI_NO_INNOEXTRACT) -endif() - ############################################ # Documentation section # ############################################ diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 01696f8dd..f1e54a8d9 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -1,5 +1,6 @@ if(ENABLE_INNOEXTRACT) add_subdirectory("lib/innoextract") + add_definitions(-DENABLE_INNOEXTRACT) endif() set(launcher_SRCS diff --git a/launcher/firstLaunch/firstlaunch_moc.cpp b/launcher/firstLaunch/firstlaunch_moc.cpp index 7c5fba4d4..0ea484ffa 100644 --- a/launcher/firstLaunch/firstlaunch_moc.cpp +++ b/launcher/firstLaunch/firstlaunch_moc.cpp @@ -21,7 +21,7 @@ #include "../../lib/filesystem/Filesystem.h" #include "../languages.h" -#ifndef VCMI_NO_INNOEXTRACT +#ifdef ENABLE_INNOEXTRACT #include "cli/extract.hpp" #endif @@ -37,7 +37,7 @@ FirstLaunchView::FirstLaunchView(QWidget * parent) ui->lineEditDataSystem->setText(pathToQString(boost::filesystem::absolute(VCMIDirs::get().dataPaths().front()))); ui->lineEditDataUser->setText(pathToQString(boost::filesystem::absolute(VCMIDirs::get().userDataPath()))); -#ifdef VCMI_NO_INNOEXTRACT +#ifndef ENABLE_INNOEXTRACT ui->pushButtonGogInstall->hide(); #endif } @@ -295,7 +295,7 @@ QString FirstLaunchView::getHeroesInstallDir() void FirstLaunchView::extractGogData() { -#ifndef VCMI_NO_INNOEXTRACT +#ifdef ENABLE_INNOEXTRACT QString filterExe = tr("GOG executable") + " (*.exe)"; QString fileExe = QFileDialog::getOpenFileName(this, tr("Select a GOG installer (exe) file..."), QDir::homePath(), filterExe); if(fileExe.isEmpty()) @@ -309,7 +309,7 @@ void FirstLaunchView::extractGogData() QTimer::singleShot(100, this, [this, fileExe, fileBin](){ // background to make sure FileDialog is closed... QTemporaryDir dir; if(dir.isValid()) { - QDir tempDir = QDir(dir.path()); + QDir tempDir{dir.path()}; ui->pushButtonGogInstall->setText(tr("Installing... Please wait!")); QPalette pal = ui->pushButtonGogInstall->palette();