Merge pull request #9 from zturtleman/install_wizard_linux_osx

Fix compiling using linux qt4 and osx qt5
This commit is contained in:
Zachary J. Slater 2014-11-18 17:01:09 -08:00
commit 50c8b3be07
8 changed files with 28 additions and 23 deletions

View file

@ -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));

View file

@ -62,12 +62,12 @@ void InstallWizard_Copy::initializePage()
qRegisterMetaType<QList<FileOperation> >("QList<FileOperation>");
copyWorker = new FileCopyWorker(((InstallWizard *)wizard())->getFileCopyOperations());
copyWorker->moveToThread(&copyThread);
connect(&copyThread, &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(&copyThread, 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<FileOperation>)), this, SLOT(finishCopy(QList<FileOperation>)));
copyThread.start();
emit copy();

View file

@ -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<FileOperation> >("QList<FileOperation>");
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<FileOperation>)), this, SLOT(finishExtract(QList<FileOperation>)));
extractThread.start();
emit extract();
}

View file

@ -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())
{

View file

@ -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

View file

@ -42,7 +42,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <QtZlib/zlib.h>
#include <zlib.h>
#if defined(USE_FILE32API)
#define fopen64 fopen

View file

@ -72,7 +72,7 @@
#define NOUNCRYPT
#endif
#include <QtZlib/zlib.h>
#include <zlib.h>
#include "unzip.h"
#ifdef STDC

View file

@ -48,7 +48,7 @@ extern "C" {
#endif
#ifndef _ZLIB_H
#include <QtZlib/zlib.h>
#include <zlib.h>
#endif
#ifndef _ZLIBIOAPI_H