diff options
author | Jan Dalheimer <jan@dalheimer.de> | 2014-02-21 20:13:12 +0100 |
---|---|---|
committer | Jan Dalheimer <jan@dalheimer.de> | 2014-02-21 20:13:12 +0100 |
commit | a354e8bfae812b23b85b65c4a5b7e860cb18080c (patch) | |
tree | c17a45f4104bcc62cf1565bba06b79ed599ed8b0 /logic/tools/MCEditTool.cpp | |
parent | 16d378687c24f9572b70c96ffd81e4b7f710777b (diff) | |
download | MultiMC-a354e8bfae812b23b85b65c4a5b7e860cb18080c.tar MultiMC-a354e8bfae812b23b85b65c4a5b7e860cb18080c.tar.gz MultiMC-a354e8bfae812b23b85b65c4a5b7e860cb18080c.tar.lz MultiMC-a354e8bfae812b23b85b65c4a5b7e860cb18080c.tar.xz MultiMC-a354e8bfae812b23b85b65c4a5b7e860cb18080c.zip |
Fix MCEdit on OSX
Diffstat (limited to 'logic/tools/MCEditTool.cpp')
-rw-r--r-- | logic/tools/MCEditTool.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/logic/tools/MCEditTool.cpp b/logic/tools/MCEditTool.cpp index c4edece5..e22a5d4a 100644 --- a/logic/tools/MCEditTool.cpp +++ b/logic/tools/MCEditTool.cpp @@ -2,6 +2,8 @@ #include <QDir> #include <QProcess> +#include <QDesktopServices> +#include <QUrl> #include "settingsobject.h" #include "logic/BaseInstance.h" @@ -20,6 +22,13 @@ void MCEditTool::runImpl() { return; } +#ifdef Q_OS_OSX + QProcess *process = new QProcess(); + connect(process, SIGNAL(finished(int, QProcess::ExitStatus)), process, SLOT(deleteLater())); + process->setProgram(mceditPath); + process->setArguments(QStringList() << save); + process->start(); +#else QDir mceditDir(mceditPath); QString program; if (mceditDir.exists("mcedit.py")) @@ -31,6 +40,7 @@ void MCEditTool::runImpl() program = mceditDir.absoluteFilePath("mcedit.exe"); } QProcess::startDetached(program, QStringList() << save, mceditPath); +#endif } void MCEditFactory::registerSettings(SettingsObject *settings) @@ -58,9 +68,9 @@ 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")) + if (!dir.exists("mcedit.py") && !dir.exists("mcedit.exe") && !dir.exists("Contents")) { - *error = QObject::tr("Path does not contain mcedit.py"); + *error = QObject::tr("Path does not seem to be a MCEdit path"); return false; } return true; |