From a3287b1c246246867db089a9dc7b9e032c465ed7 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 18 Nov 2014 17:33:00 -0600 Subject: [PATCH 1/2] Make install wizard work with Linux Qt4 --- installwizard.cpp | 2 +- installwizard_copy.cpp | 12 ++++++------ installwizard_patch.cpp | 18 +++++++++--------- installwizard_setup.cpp | 8 ++++---- minizip/ioapi.h | 2 +- minizip/unzip.c | 2 +- minizip/unzip.h | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/installwizard.cpp b/installwizard.cpp index fe0ae1e..349880e 100644 --- a/installwizard.cpp +++ b/installwizard.cpp @@ -45,7 +45,7 @@ InstallWizard::InstallWizard(QWidget *parent, Settings *settings) : setButtonLayout(layout); ui->setupUi(this); - connect(cancelButton, &QPushButton::clicked, this, &InstallWizard::cancel); + connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel())); setPage(Page_Setup, new InstallWizard_Setup(this, settings)); setPage(Page_Eula, new InstallWizard_Eula(this)); diff --git a/installwizard_copy.cpp b/installwizard_copy.cpp index 8017224..8208ff0 100644 --- a/installwizard_copy.cpp +++ b/installwizard_copy.cpp @@ -62,12 +62,12 @@ void InstallWizard_Copy::initializePage() qRegisterMetaType >("QList"); copyWorker = new FileCopyWorker(((InstallWizard *)wizard())->getFileCopyOperations()); copyWorker->moveToThread(©Thread); - connect(©Thread, &QThread::finished, copyWorker, &QObject::deleteLater); - connect(this, &InstallWizard_Copy::copy, copyWorker, &FileCopyWorker::copy); - connect(copyWorker, &FileCopyWorker::fileChanged, this, &InstallWizard_Copy::setCopyFilename); - connect(copyWorker, &FileCopyWorker::progressChanged, this, &InstallWizard_Copy::setCopyProgress); - connect(copyWorker, &FileCopyWorker::errorMessage, this, &InstallWizard_Copy::setCopyErrorMessage); - connect(copyWorker, &FileCopyWorker::copyFinished, this, &InstallWizard_Copy::finishCopy); + connect(©Thread, SIGNAL(finished()), copyWorker, SLOT(deleteLater())); + connect(this, SIGNAL(copy()), copyWorker, SLOT(copy())); + connect(copyWorker, SIGNAL(fileChanged(const QString)), this, SLOT(setCopyFilename(const QString))); + connect(copyWorker, SIGNAL(progressChanged(qint64,qint64)), this, SLOT(setCopyProgress(qint64,qint64))); + connect(copyWorker, SIGNAL(errorMessage(const QString)), this, SLOT(setCopyErrorMessage(const QString))); + connect(copyWorker, SIGNAL(copyFinished(QList)), this, SLOT(finishCopy(QList))); copyThread.start(); emit copy(); diff --git a/installwizard_patch.cpp b/installwizard_patch.cpp index 90bde16..a0043f8 100644 --- a/installwizard_patch.cpp +++ b/installwizard_patch.cpp @@ -66,9 +66,9 @@ void InstallWizard_Patch::initializePage() #endif networkReply = nam.get(networkRequest); - connect(networkReply, &QNetworkReply::readyRead, this, &InstallWizard_Patch::downloadRead); - connect(networkReply, &QNetworkReply::downloadProgress, this, &InstallWizard_Patch::updateProgress); - connect(networkReply, &QNetworkReply::finished, this, &InstallWizard_Patch::downloadFinished); + connect(networkReply, SIGNAL(readyRead()), this, SLOT(downloadRead())); + connect(networkReply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(updateProgress(qint64,qint64))); + connect(networkReply, SIGNAL(finished()), this, SLOT(downloadFinished())); } void InstallWizard_Patch::cleanupPage() @@ -141,12 +141,12 @@ void InstallWizard_Patch::downloadFinished() qRegisterMetaType >("QList"); extractWorker = new FileExtractWorker(patchFile->fileName(), filesToExtract); extractWorker->moveToThread(&extractThread); - connect(&extractThread, &QThread::finished, extractWorker, &QObject::deleteLater); - connect(this, &InstallWizard_Patch::extract, extractWorker, &FileExtractWorker::extract); - connect(extractWorker, &FileExtractWorker::fileChanged, this, &InstallWizard_Patch::setExtractFilename); - connect(extractWorker, &FileExtractWorker::progressChanged, this, &InstallWizard_Patch::updateProgress); - connect(extractWorker, &FileExtractWorker::errorMessage, this, &InstallWizard_Patch::setErrorMessage); - connect(extractWorker, &FileExtractWorker::finished, this, &InstallWizard_Patch::finishExtract); + connect(&extractThread, SIGNAL(finished()), extractWorker, SLOT(deleteLater())); + connect(this, SIGNAL(extract()), extractWorker, SLOT(extract())); + connect(extractWorker, SIGNAL(fileChanged(const QString)), this, SLOT(setExtractFilename(const QString))); + connect(extractWorker, SIGNAL(progressChanged(qint64,qint64)), this, SLOT(updateProgress(qint64,qint64))); + connect(extractWorker, SIGNAL(errorMessage(const QString)), this, SLOT(setErrorMessage(const QString))); + connect(extractWorker, SIGNAL(finished(QList)), this, SLOT(finishExtract(QList))); extractThread.start(); emit extract(); } diff --git a/installwizard_setup.cpp b/installwizard_setup.cpp index 94451ef..186abfe 100644 --- a/installwizard_setup.cpp +++ b/installwizard_setup.cpp @@ -122,7 +122,7 @@ bool InstallWizard_Setup::validatePage() if (ui->stackPages->currentIndex() == Page_Install) { - QDir dir(ui->cbInstallSource->currentData().toString()); + QDir dir(ui->cbInstallSource->currentText()); if (!dir.exists()) { @@ -135,7 +135,7 @@ bool InstallWizard_Setup::validatePage() // Copy page will copy baseq3/pak0.pk3. iw->clearFileCopyOperations(); - iw->addFileCopyOperation(ui->cbInstallSource->currentData().toString() + QString("/QUAKE3/baseq3/pak0.pk3"), ui->txtInstallDest->text() + QString("/baseq3/pak0.pk3")); + iw->addFileCopyOperation(ui->cbInstallSource->currentText() + QString("/QUAKE3/baseq3/pak0.pk3"), ui->txtInstallDest->text() + QString("/baseq3/pak0.pk3")); iw->setQuakePath(ui->txtInstallDest->text()); } else if (ui->stackPages->currentIndex() == Page_InstallSteam) @@ -214,7 +214,7 @@ bool InstallWizard_Setup::isComplete() const { if (ui->stackPages->currentIndex() == Page_Install) { - return !ui->cbInstallSource->currentData().toString().isEmpty() && !ui->txtInstallDest->text().isEmpty(); + return !ui->cbInstallSource->currentText().isEmpty() && !ui->txtInstallDest->text().isEmpty(); } else if (ui->stackPages->currentIndex() == Page_InstallSteam) { @@ -288,7 +288,7 @@ void InstallWizard_Setup::on_txtLocatePath_textChanged(const QString & /*arg1*/) void InstallWizard_Setup::on_btnInstallBrowseSource_clicked() { - const QString location = QFileDialog::getExistingDirectory(wizard(), "Select Quake III Arena CD-ROM directory", ui->cbInstallSource->currentData().toString()); + const QString location = QFileDialog::getExistingDirectory(wizard(), "Select Quake III Arena CD-ROM directory", ui->cbInstallSource->currentText()); if (!location.isEmpty()) { diff --git a/minizip/ioapi.h b/minizip/ioapi.h index 2a94e09..b6556b5 100644 --- a/minizip/ioapi.h +++ b/minizip/ioapi.h @@ -42,7 +42,7 @@ #include #include -#include +#include #if defined(USE_FILE32API) #define fopen64 fopen diff --git a/minizip/unzip.c b/minizip/unzip.c index 9fa03c0..8afe46a 100644 --- a/minizip/unzip.c +++ b/minizip/unzip.c @@ -72,7 +72,7 @@ #define NOUNCRYPT #endif -#include +#include #include "unzip.h" #ifdef STDC diff --git a/minizip/unzip.h b/minizip/unzip.h index 4c819b5..b965c46 100644 --- a/minizip/unzip.h +++ b/minizip/unzip.h @@ -48,7 +48,7 @@ extern "C" { #endif #ifndef _ZLIB_H -#include +#include #endif #ifndef _ZLIBIOAPI_H From 034c29f1aec8a689c1cf3f995fd3ea10f7f2dad6 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 18 Nov 2014 18:44:35 -0600 Subject: [PATCH 2/2] Fix install wizard zlib for OS X Qt5 --- launch.pro | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/launch.pro b/launch.pro index bbe6809..88472e0 100644 --- a/launch.pro +++ b/launch.pro @@ -58,3 +58,8 @@ RESOURCES += \ imgs.qrc RC_FILE = launch.rc + +# mac os x doesn't have fopen64 for minizip +# mac os x (qt5 at least), needs explicit zlib linking +macx:DEFINES += USE_FILE32API +macx:LIBS += -lz