chore: only enable portable mode support for windows
This commit is contained in:
parent
f3b3ad7b8a
commit
3b94eecde2
|
@ -71,6 +71,10 @@ if (WIN32)
|
||||||
TARGET ${EXE_NAME}
|
TARGET ${EXE_NAME}
|
||||||
PROPERTY WIN32_EXECUTABLE true
|
PROPERTY WIN32_EXECUTABLE true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||||
|
FLAG_PORTABLE_MODE_SUPPORT=1
|
||||||
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Helper macros for install settings
|
# Helper macros for install settings
|
||||||
|
|
|
@ -67,12 +67,14 @@ Settings::Settings()
|
||||||
{
|
{
|
||||||
QString configPath;
|
QString configPath;
|
||||||
|
|
||||||
|
#ifdef FLAG_PORTABLE_MODE_SUPPORT
|
||||||
QString portableConfigDirPath = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("data");
|
QString portableConfigDirPath = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("data");
|
||||||
QFileInfo portableConfigDirInfo(portableConfigDirPath);
|
QFileInfo portableConfigDirInfo(portableConfigDirPath);
|
||||||
if (portableConfigDirInfo.exists() && portableConfigDirInfo.isDir() && portableConfigDirInfo.isWritable()) {
|
if (portableConfigDirInfo.exists() && portableConfigDirInfo.isDir() && portableConfigDirInfo.isWritable()) {
|
||||||
// we can use it.
|
// we can use it.
|
||||||
configPath = portableConfigDirPath;
|
configPath = portableConfigDirPath;
|
||||||
}
|
}
|
||||||
|
#endif // FLAG_PORTABLE_MODE_SUPPORT
|
||||||
|
|
||||||
// %LOCALAPPDATA% under Windows.
|
// %LOCALAPPDATA% under Windows.
|
||||||
if (configPath.isEmpty()) {
|
if (configPath.isEmpty()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user