diff options
author | Petr Mrázek <peterix@gmail.com> | 2018-07-15 14:51:05 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-07-15 14:51:05 +0200 |
commit | bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9 (patch) | |
tree | e6497e304b7b9368367565fbc7c06efab1124b1c /api/logic/tools/MCEditTool.cpp | |
parent | 03280cc62e75f8073f8d3d9e9e3952acf21fa77d (diff) | |
download | MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.gz MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.lz MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.tar.xz MultiMC-bbb3b3e6f6e3c0f95873f22e6d0a4aaf350f49d9.zip |
NOISSUE tabs -> spaces
Diffstat (limited to 'api/logic/tools/MCEditTool.cpp')
-rw-r--r-- | api/logic/tools/MCEditTool.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/api/logic/tools/MCEditTool.cpp b/api/logic/tools/MCEditTool.cpp index 74715d3f..880327c7 100644 --- a/api/logic/tools/MCEditTool.cpp +++ b/api/logic/tools/MCEditTool.cpp @@ -10,68 +10,68 @@ MCEditTool::MCEditTool(SettingsObjectPtr settings) { - settings->registerSetting("MCEditPath"); - m_settings = settings; + settings->registerSetting("MCEditPath"); + m_settings = settings; } void MCEditTool::setPath(QString& path) { - m_settings->set("MCEditPath", path); + m_settings->set("MCEditPath", path); } QString MCEditTool::path() const { - return m_settings->get("MCEditPath").toString(); + return m_settings->get("MCEditPath").toString(); } bool MCEditTool::check(const QString& toolPath, QString& error) { - if (toolPath.isEmpty()) - { - error = QObject::tr("Path is empty"); - return false; - } - const QDir dir(toolPath); - if (!dir.exists()) - { - error = QObject::tr("Path does not exist"); - return false; - } - if (!dir.exists("mcedit.sh") && !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; - } - return true; + if (toolPath.isEmpty()) + { + error = QObject::tr("Path is empty"); + return false; + } + const QDir dir(toolPath); + if (!dir.exists()) + { + error = QObject::tr("Path does not exist"); + return false; + } + if (!dir.exists("mcedit.sh") && !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; + } + return true; } QString MCEditTool::getProgramPath() { #ifdef Q_OS_OSX - return path(); + return path(); #else - const QString mceditPath = path(); - QDir mceditDir(mceditPath); + const QString mceditPath = path(); + QDir mceditDir(mceditPath); #ifdef Q_OS_LINUX - if (mceditDir.exists("mcedit.sh")) - { - return mceditDir.absoluteFilePath("mcedit.sh"); - } - else if (mceditDir.exists("mcedit.py")) - { - return mceditDir.absoluteFilePath("mcedit.py"); - } - return QString(); + if (mceditDir.exists("mcedit.sh")) + { + return mceditDir.absoluteFilePath("mcedit.sh"); + } + else if (mceditDir.exists("mcedit.py")) + { + return mceditDir.absoluteFilePath("mcedit.py"); + } + return QString(); #elif defined(Q_OS_WIN32) - if (mceditDir.exists("mcedit.exe")) - { - return mceditDir.absoluteFilePath("mcedit.exe"); - } - else if (mceditDir.exists("mcedit2.exe")) - { - return mceditDir.absoluteFilePath("mcedit2.exe"); - } - return QString(); + if (mceditDir.exists("mcedit.exe")) + { + return mceditDir.absoluteFilePath("mcedit.exe"); + } + else if (mceditDir.exists("mcedit2.exe")) + { + return mceditDir.absoluteFilePath("mcedit2.exe"); + } + return QString(); #endif #endif } |