diff --git a/RedPandaIDE/utils.cpp b/RedPandaIDE/utils.cpp index dcc0bcd5..ef86e54f 100644 --- a/RedPandaIDE/utils.cpp +++ b/RedPandaIDE/utils.cpp @@ -335,10 +335,9 @@ int getNewFileNumber() #ifdef Q_OS_WIN static bool gIsGreenEdition = true; static bool gIsGreenEditionInited = false; -#endif + bool isGreenEdition() { -#ifdef Q_OS_WIN if (!gIsGreenEditionInited) { QString appPath = QApplication::instance()->applicationDirPath(); appPath = excludeTrailingPathDelimiter(localizePath(appPath)); @@ -364,10 +363,8 @@ bool isGreenEdition() gIsGreenEditionInited = true; } return gIsGreenEdition; -#else - return false; -#endif } +#endif QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const QStringList& arguments, const QByteArray &inputContent, bool inheritEnvironment, diff --git a/RedPandaIDE/utils.h b/RedPandaIDE/utils.h index 4a9a2981..7fb3c251 100644 --- a/RedPandaIDE/utils.h +++ b/RedPandaIDE/utils.h @@ -155,7 +155,11 @@ void executeFile(const QString& fileName, const QString& workingDir, const QString& tempFile); +#ifdef Q_OS_WIN bool isGreenEdition(); +#else +constexpr bool isGreenEdition() { return false; } +#endif #ifdef Q_OS_WIN bool readRegistry(HKEY key, const QString& subKey, const QString& name, QString& value);