make `isGreenEdition` constexpr on Unix (#392)
This commit is contained in:
parent
4797e53b61
commit
5e9d9504d2
|
@ -335,10 +335,9 @@ int getNewFileNumber()
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
static bool gIsGreenEdition = true;
|
static bool gIsGreenEdition = true;
|
||||||
static bool gIsGreenEditionInited = false;
|
static bool gIsGreenEditionInited = false;
|
||||||
#endif
|
|
||||||
bool isGreenEdition()
|
bool isGreenEdition()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
if (!gIsGreenEditionInited) {
|
if (!gIsGreenEditionInited) {
|
||||||
QString appPath = QApplication::instance()->applicationDirPath();
|
QString appPath = QApplication::instance()->applicationDirPath();
|
||||||
appPath = excludeTrailingPathDelimiter(localizePath(appPath));
|
appPath = excludeTrailingPathDelimiter(localizePath(appPath));
|
||||||
|
@ -364,10 +363,8 @@ bool isGreenEdition()
|
||||||
gIsGreenEditionInited = true;
|
gIsGreenEditionInited = true;
|
||||||
}
|
}
|
||||||
return gIsGreenEdition;
|
return gIsGreenEdition;
|
||||||
#else
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const QStringList& arguments,
|
QByteArray runAndGetOutput(const QString &cmd, const QString& workingDir, const QStringList& arguments,
|
||||||
const QByteArray &inputContent, bool inheritEnvironment,
|
const QByteArray &inputContent, bool inheritEnvironment,
|
||||||
|
|
|
@ -155,7 +155,11 @@ void executeFile(const QString& fileName,
|
||||||
const QString& workingDir,
|
const QString& workingDir,
|
||||||
const QString& tempFile);
|
const QString& tempFile);
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
bool isGreenEdition();
|
bool isGreenEdition();
|
||||||
|
#else
|
||||||
|
constexpr bool isGreenEdition() { return false; }
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
bool readRegistry(HKEY key, const QString& subKey, const QString& name, QString& value);
|
bool readRegistry(HKEY key, const QString& subKey, const QString& name, QString& value);
|
||||||
|
|
Loading…
Reference in New Issue