diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 11:49:55 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-02-16 11:49:55 +0100 |
commit | c88c639b8efdcdfe87c2ce44fa270889826b38ef (patch) | |
tree | c85b6311dfae21bcb67615bbad85bbc05b6617e0 /logic | |
parent | 616c37269053bc4f111792dbb9374cc119a58339 (diff) | |
download | MultiMC-c88c639b8efdcdfe87c2ce44fa270889826b38ef.tar MultiMC-c88c639b8efdcdfe87c2ce44fa270889826b38ef.tar.gz MultiMC-c88c639b8efdcdfe87c2ce44fa270889826b38ef.tar.lz MultiMC-c88c639b8efdcdfe87c2ce44fa270889826b38ef.tar.xz MultiMC-c88c639b8efdcdfe87c2ce44fa270889826b38ef.zip |
Fix for windows and update tool menu after closing settings dialog
Diffstat (limited to 'logic')
-rw-r--r-- | logic/MCEditTool.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/logic/MCEditTool.cpp b/logic/MCEditTool.cpp index 93ffb7a5..14dc1b96 100644 --- a/logic/MCEditTool.cpp +++ b/logic/MCEditTool.cpp @@ -23,8 +23,16 @@ void MCEditTool::runImpl() { return; } - const QString program = - QDir(mceditPath).absoluteFilePath("mcedit.py"); + QDir mceditDir(mceditPath); + QString program; + if (mceditDir.exists("mcedit.py")) + { + program = mceditDir.absoluteFilePath("mcedit.py"); + } + else if (mceditDir.exists("mcedit.exe")) + { + program = mceditDir.absoluteFilePath("mcedit.exe"); + } QProcess::startDetached(program, QStringList() << save, mceditPath); } @@ -53,7 +61,7 @@ bool MCEditFactory::check(const QString &path, QString *error) *error = QObject::tr("Path does not exist"); return false; } - if (!dir.exists("mcedit.py")) + if (!dir.exists("mcedit.py") && !dir.exists("mcedit.exe")) { *error = QObject::tr("Path does not contain mcedit.py"); return false; |