diff options
author | Petr Mrázek <peterix@gmail.com> | 2015-06-10 23:51:05 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2015-06-10 23:51:05 +0200 |
commit | 1feb4bb387f1dc559a6d368f77171a6e066a69e6 (patch) | |
tree | 5221ad55e668a1833b575650adb9db8f48bf4f48 /logic/tools | |
parent | dd97ea80294ecd1cf8f9a68d3dd58a658ea74963 (diff) | |
download | MultiMC-1feb4bb387f1dc559a6d368f77171a6e066a69e6.tar MultiMC-1feb4bb387f1dc559a6d368f77171a6e066a69e6.tar.gz MultiMC-1feb4bb387f1dc559a6d368f77171a6e066a69e6.tar.lz MultiMC-1feb4bb387f1dc559a6d368f77171a6e066a69e6.tar.xz MultiMC-1feb4bb387f1dc559a6d368f77171a6e066a69e6.zip |
GH-1009 add mcedit.pyc as a valid mcedit 'executable'
Diffstat (limited to 'logic/tools')
-rw-r--r-- | logic/tools/MCEditTool.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/logic/tools/MCEditTool.cpp b/logic/tools/MCEditTool.cpp index 058eede8..03329a73 100644 --- a/logic/tools/MCEditTool.cpp +++ b/logic/tools/MCEditTool.cpp @@ -63,11 +63,17 @@ void MCEditTool::runImpl() #else QDir mceditDir(mceditPath); QString program; + #ifdef Q_OS_LINUX if (mceditDir.exists("mcedit.py")) { program = mceditDir.absoluteFilePath("mcedit.py"); } - else if (mceditDir.exists("mcedit.exe")) + else if (mceditDir.exists("mcedit.pyc")) + { + program = mceditDir.absoluteFilePath("mcedit.pyc"); + } + #elif defined(Q_OS_WIN32) + if (mceditDir.exists("mcedit.exe")) { program = mceditDir.absoluteFilePath("mcedit.exe"); } @@ -75,7 +81,11 @@ void MCEditTool::runImpl() { program = mceditDir.absoluteFilePath("mcedit2.exe"); } - QProcess::startDetached(program, QStringList() << save, mceditPath); + #endif + if(program.size()) + { + QProcess::startDetached(program, QStringList() << save, mceditPath); + } #endif } @@ -105,7 +115,7 @@ bool MCEditFactory::check(const QString &path, QString *error) *error = QObject::tr("Path does not exist"); return false; } - if (!dir.exists("mcedit.py") && !dir.exists("mcedit.exe") && !dir.exists("Contents") && !dir.exists("mcedit2.exe")) + if (!dir.exists("mcedit.pyc") && !dir.exists("mcedit.py") && !dir.exists("mcedit.exe") && !dir.exists("Contents") && !dir.exists("mcedit2.exe")) { *error = QObject::tr("Path does not seem to be a MCEdit path"); return false; |