diff --git a/source/NewProjectPage.h b/source/NewProjectPage.h index a64ec9f..e59ad0e 100644 --- a/source/NewProjectPage.h +++ b/source/NewProjectPage.h @@ -1,7 +1,12 @@ #ifndef NEWPROJECTPAGE_H #define NEWPROJECTPAGE_H +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#else +#include +#endif #include "ui_NewProjectPage.h" using namespace Ui; diff --git a/source/PlatformCheck.cpp b/source/PlatformCheck.cpp index ae39e5c..b602c95 100644 --- a/source/PlatformCheck.cpp +++ b/source/PlatformCheck.cpp @@ -1,12 +1,23 @@ #include "PlatformCheck.h" +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#else +#include +#endif -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) bool PlatformCheck::mWin = true; bool PlatformCheck::mMac = false; -#endif - -#ifdef Q_OS_MAC + bool PlatformCheck::mLin = false; +#elif defined(Q_OS_MACOS) + bool PlatformCheck::mWin = false; bool PlatformCheck::mMac = true; + bool PlatformCheck::mLin = false; +#elif defined(Q_OS_LINUX) + bool PlatformCheck::mMac = false; bool PlatformCheck::mWin = false; + bool PlatformCheck::mLin = true; +#else + #error Not a Windows, MacOS, or Linux system, aborting #endif diff --git a/source/PlatformCheck.h b/source/PlatformCheck.h index 2b40589..e0f3ecd 100644 --- a/source/PlatformCheck.h +++ b/source/PlatformCheck.h @@ -9,9 +9,11 @@ class PlatformCheck //~NewProjectPage(); static bool mWin; static bool mMac; + static bool mLin; static bool isWin() { return PlatformCheck::mWin; }; static bool isMac() { return PlatformCheck::mMac; }; + static bool isLin() { return PlatformCheck::mLin; }; }; -#endif // PLATFORMCHECK_H \ No newline at end of file +#endif // PLATFORMCHECK_H diff --git a/source/ProgressFinishedDialog.cpp b/source/ProgressFinishedDialog.cpp index bfe0c3a..8387720 100644 --- a/source/ProgressFinishedDialog.cpp +++ b/source/ProgressFinishedDialog.cpp @@ -1,5 +1,10 @@ #include "ProgressFinishedDialog.h" +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#else +#include +#endif ProgressFinishedDialog::ProgressFinishedDialog(QWidget *parent) : QDialog(parent) @@ -27,4 +32,4 @@ void ProgressFinishedDialog::hideFolderButton() void ProgressFinishedDialog::on_OpenFolderButton_clicked() { QDesktopServices::openUrl(QUrl("file:///" + mFolderLocation)); -} \ No newline at end of file +} diff --git a/source/ProjectModuleListPage.cpp b/source/ProjectModuleListPage.cpp index 8ce9123..0e38070 100644 --- a/source/ProjectModuleListPage.cpp +++ b/source/ProjectModuleListPage.cpp @@ -201,6 +201,7 @@ void ProjectModuleListPage::populateControls() if(mCurrentInstance) { ModuleList* list = mFrontloader->getModuleList(); + Q_UNUSED(list) // Module Groups for(int i=0; imModuleGroupInstances.count(); ++i) diff --git a/source/ProjectTree.cpp b/source/ProjectTree.cpp index 0d9dba1..8c1cc3b 100644 --- a/source/ProjectTree.cpp +++ b/source/ProjectTree.cpp @@ -268,18 +268,22 @@ void ProjectScrollArea::mousePressEvent(QMouseEvent *pressEvent) void ProjectTree::projectEntryRemoved(ProjectEntry *entry) { + Q_UNUSED(entry) } void ProjectTree::projectEntryAdded(ProjectEntry *entry) { + Q_UNUSED(entry) } void ProjectTree::projectCategoryAdded(QString title) { + Q_UNUSED(title) } void ProjectTree::projectCategoryRemoved(QString title) { + Q_UNUSED(title) } ProjectEntry *ProjectTree::getEntryFromAppName(QString uniqueName, QString appName) diff --git a/source/copyDir.h b/source/copyDir.h index d28ebce..27012fc 100644 --- a/source/copyDir.h +++ b/source/copyDir.h @@ -2,7 +2,12 @@ #define _COPY_DIR_H_ #include +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#else +#include +#endif #include class Torque3DFrontloader; diff --git a/source/moduleList.h b/source/moduleList.h index fe4cb40..abc9dc6 100644 --- a/source/moduleList.h +++ b/source/moduleList.h @@ -1,7 +1,12 @@ #ifndef _MODULE_LIST_H_ #define _MODULE_LIST_H_ +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#else +#include +#endif #include #include diff --git a/source/projectList.cpp b/source/projectList.cpp index 64f5e4b..94cad31 100644 --- a/source/projectList.cpp +++ b/source/projectList.cpp @@ -18,6 +18,7 @@ QString ProjectEntry::getLevelPath() ProjectList::ProjectList(QWidget *parent) { + Q_UNUSED(parent) mAppName = "No app name has been set"; mParent = NULL; mProcess = NULL; @@ -40,7 +41,7 @@ QString ProjectList::getAppPath(QString path) { basePath = path; } -#ifdef Q_OS_MAC +#if defined(Q_OS_MACOS) int appIndex = basePath.lastIndexOf(QString(".app")); int basePathIndex = basePath.lastIndexOf("/", appIndex); QString macPath = basePath.left(basePathIndex); @@ -332,6 +333,7 @@ BOOL CALLBACK ProjectList::EnumWindowsProc(HWND hwnd, LPARAM param) void ProjectList::toggleEditor(int editorMode) { + Q_UNUSED(editorMode) #ifdef Q_OS_WIN //PostMessage(ProjectList::appWindow, WM_TOGGLE_EDITOR, editorMode, 0); #endif @@ -351,4 +353,4 @@ ProjectEntry *ProjectList::getFirstProjectEntry() } return entry; -} \ No newline at end of file +} diff --git a/source/torque3dfrontloader.cpp b/source/torque3dfrontloader.cpp index 205a336..137fe93 100644 --- a/source/torque3dfrontloader.cpp +++ b/source/torque3dfrontloader.cpp @@ -170,6 +170,7 @@ Torque3DFrontloader::~Torque3DFrontloader() bool Torque3DFrontloader::setSelectedProjectByUniqueName(const QString &uniqueName, bool setFirstIfNot) { + Q_UNUSED(setFirstIfNot) int size = ui.ProjectTreeList->mProjectAppList.values(uniqueName).size(); if(size == 0) return false; @@ -415,6 +416,7 @@ if(path.compare(mAppStyleSheetPath) == 0) void Torque3DFrontloader::directoryChanged(const QString &path) { + Q_UNUSED(path) } void Torque3DFrontloader::hideApp() @@ -457,15 +459,18 @@ void Torque3DFrontloader::iconActivated(QSystemTrayIcon::ActivationReason reason void Torque3DFrontloader::resizeEvent(QResizeEvent *event) { + Q_UNUSED(event) //event->ignore(); } void Torque3DFrontloader::closeEvent(QCloseEvent *event) { + Q_UNUSED(event) } void Torque3DFrontloader::hideEvent(QHideEvent *event) { + Q_UNUSED(event) } void Torque3DFrontloader::clearEditorSettings() @@ -546,6 +551,7 @@ void Torque3DFrontloader::updateSelectedProjectInfo() void Torque3DFrontloader::setSelectedApp(ProjectEntry *app, bool skipWidgetUpdate) { + Q_UNUSED(skipWidgetUpdate) if(app != NULL) { mSelectedApp = app; @@ -589,6 +595,7 @@ void Torque3DFrontloader::packageProjectStaging() if(!outputDir.exists()) { bool createPath = outputDir.mkpath(outputDir.path()); + Q_UNUSED(createPath) } QDir rootProjectPath(getSelectedProject()->getAppPath()); @@ -641,7 +648,7 @@ void Torque3DFrontloader::packageProjectStaging() } } - if(PlatformCheck::isMac()) + if(PlatformCheck::isMac() || PlatformCheck::isLin()) { QString webAdd; if(!mPackagingWebDone) @@ -1037,7 +1044,7 @@ void Torque3DFrontloader::createProjectGeneration() QString phpPath(mBaseAppPath + "/Engine/bin/php/php.exe"); mProjectGenerationProcess->start(phpPath, argList); } - else if(PlatformCheck::isMac()) + else if(PlatformCheck::isMac() || PlatformCheck::isLin()) { QString phpPath("/usr/bin/php"); mProjectGenerationProcess->start(phpPath, argList); @@ -1055,6 +1062,8 @@ void Torque3DFrontloader::projectGenerationError() void Torque3DFrontloader::projectGenerationFinished(int exitCode, QProcess::ExitStatus exitStatus) { + Q_UNUSED(exitCode) + Q_UNUSED(exitStatus) if(!mProjectGenerationExitNow) { mProgressDialog->setSubStageProgress(100); @@ -1142,6 +1151,7 @@ void Torque3DFrontloader::updateCreateProjectDone(bool success, bool exitNow) { int ret = QMessageBox::information(this, "Failed", "Project Creation has Failed.\n" "Unable to copy project files, ensure no other applications are currently accessing these files"); + Q_UNUSED(ret) mCopyDir.quit(); mProgressDialog->fail(); } @@ -1212,6 +1222,7 @@ void Torque3DFrontloader::packageProject(QString projectOutputPath) void Torque3DFrontloader::packageInstaller(bool isWeb) { + Q_UNUSED(isWeb) mProgressDialog->incStage(); } @@ -1249,6 +1260,7 @@ void Torque3DFrontloader::packageZip() if(!outputDir.exists()) { bool createPath = outputDir.mkpath(outputDir.path()); + Q_UNUSED(createPath) } outputDir.setPath(outputDir.path() + QDir::separator() + mSelectedProject->mName); @@ -1256,6 +1268,7 @@ void Torque3DFrontloader::packageZip() if(!outputDir.exists()) { bool createPath = outputDir.mkpath(outputDir.path()); + Q_UNUSED(createPath) } QString zipPath; @@ -1265,7 +1278,7 @@ void Torque3DFrontloader::packageZip() { zipPath.append(mZipAppPath + QDir::separator() + mZipAppName); } - else if(PlatformCheck::isMac()) + else if(PlatformCheck::isMac() || PlatformCheck::isLin()) { zipPath.append("zip"); } @@ -1297,6 +1310,7 @@ void Torque3DFrontloader::packageWeb() QFileInfoList entryList = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::Files); bool deleted = deletePath(mPackagingGameOutputPath + "/web", false); + Q_UNUSED(deleted) for(int i=0; i < entryList.size(); i++) { @@ -1307,6 +1321,7 @@ void Torque3DFrontloader::packageWeb() if(entry.exists()) { bool copied = QFile::copy(entry.absoluteFilePath(), dstPath); + Q_UNUSED(copied) } } @@ -1330,7 +1345,7 @@ void Torque3DFrontloader::loadStylesheet() styleFile.close(); } - if(PlatformCheck::isMac()) + if(PlatformCheck::isMac() || PlatformCheck::isLin()) { styleFile.setFileName(":/Torque3DFrontloader/resources/style.css"); if(styleFile.open(QIODevice::ReadOnly)) @@ -1369,14 +1384,17 @@ void Torque3DFrontloader::projectRemovalDone() void Torque3DFrontloader::projectEntryAdded(ProjectEntry *entry) { + Q_UNUSED(entry) } void Torque3DFrontloader::projectCategoryAdded(QString title) { + Q_UNUSED(title) } void Torque3DFrontloader::projectCategoryRemoved(QString title) { + Q_UNUSED(title) } @@ -1475,6 +1493,10 @@ void Torque3DFrontloader::openSourceCode() { sourceProject.append(QString("/Xcode/%1.xcodeproj").arg(entry->mName)); } + else if(PlatformCheck::isLin()) + { + sourceProject.append(QString("%1.pro").arg(entry->mName)); + } QFile sourceProjectFile(sourceProject); if(sourceProjectFile.exists()) @@ -1493,6 +1515,11 @@ void Torque3DFrontloader::openSourceCode() QMessageBox::information(this, tr("Opening Source Code"), tr("The Xcode project file has been called and Xcode should") + tr(" be opening. This may take a moment. If it does not properly open ensure you have Xcode installed")); } + else if(PlatformCheck::isLin()) + { + QMessageBox::information(this, tr("Opening Source Code"), tr("The Qt project file has been called and Qt Creator should") + + tr(" be opening. This may take a moment. If it does not properly open ensure you have Qt Creator installed")); + } } else { @@ -1594,7 +1621,7 @@ bool Torque3DFrontloader::generateProjects(QString rootPath) data = process->readAll(); } - else if(PlatformCheck::isMac()) + else if(PlatformCheck::isMac() || PlatformCheck::isLin()) { QString phpPath("/usr/bin/php"); QProcess *process = new QProcess(this); @@ -1612,25 +1639,30 @@ bool Torque3DFrontloader::generateProjects(QString rootPath) void Torque3DFrontloader::pauseProcess(QProcess *process) { -#ifdef Q_OS_WIN + Q_UNUSED(process) +#if defined(Q_OS_WIN) _PROCESS_INFORMATION *pi = process->pid(); PauseResumeThreadList(pi->dwProcessId); -#endif - -#ifdef Q_OS_MAC +#elif defined(Q_OS_MACOS) ::kill(process->pid(), SIGSTOP); +#elif defined(Q_OS_LINUX) + kill(pid_t(process->pid()), SIGSTOP); +#else + #error Not a Windows, MacOS, or Linux system, aborting #endif } void Torque3DFrontloader::resumeProcess(QProcess *process) { -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) _PROCESS_INFORMATION *pi = process->pid(); PauseResumeThreadList(pi->dwProcessId, true); -#endif - -#ifdef Q_OS_MAC +#elif defined(Q_OS_MACOS) ::kill(process->pid(), SIGCONT); +#elif defined(Q_OS_LINUX) + kill(pid_t(process->pid()), SIGCONT); +#else + #error Not a Windows, MacOS, or Linux system, aborting #endif } @@ -1697,6 +1729,16 @@ bool Torque3DFrontloader::getResourceInfo(const QString &filePath, QString &plug QString &productName, QString &companyName, QString &companyKey, QString &version) { + Q_UNUSED(filePath) + Q_UNUSED(plugin) + Q_UNUSED(fileDesc) + Q_UNUSED(internalName) + Q_UNUSED(mimeType) + Q_UNUSED(originalFileName) + Q_UNUSED(productName) + Q_UNUSED(companyName) + Q_UNUSED(companyKey) + Q_UNUSED(version) #ifdef Q_OS_WIN LPTSTR lpszFilePath = (TCHAR *)filePath.utf16(); @@ -1796,6 +1838,8 @@ void Torque3DFrontloader::on_OpenFolderButton_clicked() bool Torque3DFrontloader::setResourceString(const QString &filePath, const QString &name, QString &value) { + Q_UNUSED(filePath) + Q_UNUSED(name) value.clear(); #ifdef Q_OS_WIN @@ -1864,6 +1908,7 @@ void Torque3DFrontloader::renameFile(const QString &filePath, const QString &new QFileInfo fileInfo(file); QString newPath = fileInfo.absolutePath() + "/" + newName; bool rename = file.rename(newPath); + Q_UNUSED(rename) mProgressDialog->updateDetailText("renamed from " + file.fileName() + " ..."); mProgressDialog->updateDetailText("to " + newPath); } diff --git a/source/torque3dfrontloader.h b/source/torque3dfrontloader.h index dbbd3b1..7e8c2ce 100644 --- a/source/torque3dfrontloader.h +++ b/source/torque3dfrontloader.h @@ -1,7 +1,12 @@ #ifndef TORQUE3DFRONTLOADER_H #define TORQUE3DFRONTLOADER_H +#include +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) #include +#else +#include +#endif #include #include #include @@ -13,15 +18,13 @@ #include "NewProjectPage.h" #include "ProjectModuleListPage.h" -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) #include #include #include #include #include -#endif - -#ifdef Q_OS_MAC +#elif defined(Q_OS_MACOS) || defined(Q_OS_LINUX) #include #endif