| 44 | } |
| 45 | |
| 46 | QString MCEditTool::getProgramPath() |
| 47 | { |
| 48 | #ifdef Q_OS_MACOS |
| 49 | return path(); |
| 50 | #else |
| 51 | const QString mceditPath = path(); |
| 52 | QDir mceditDir(mceditPath); |
| 53 | #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD) |
| 54 | if (mceditDir.exists("mcedit.sh")) { |
| 55 | return mceditDir.absoluteFilePath("mcedit.sh"); |
| 56 | } else if (mceditDir.exists("mcedit.py")) { |
| 57 | return mceditDir.absoluteFilePath("mcedit.py"); |
| 58 | } |
| 59 | return QString(); |
| 60 | #elif defined(Q_OS_WIN32) |
| 61 | if (mceditDir.exists("mcedit.exe")) { |
| 62 | return mceditDir.absoluteFilePath("mcedit.exe"); |
| 63 | } else if (mceditDir.exists("mcedit2.exe")) { |
| 64 | return mceditDir.absoluteFilePath("mcedit2.exe"); |
| 65 | } |
| 66 | return QString(); |
| 67 | #endif |
| 68 | #endif |
| 69 | } |
no test coverage detected