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}
|
||||
PROPERTY WIN32_EXECUTABLE true
|
||||
)
|
||||
|
||||
target_compile_definitions(${EXE_NAME} PRIVATE
|
||||
FLAG_PORTABLE_MODE_SUPPORT=1
|
||||
)
|
||||
endif ()
|
||||
|
||||
# Helper macros for install settings
|
||||
|
|
|
@ -67,12 +67,14 @@ Settings::Settings()
|
|||
{
|
||||
QString configPath;
|
||||
|
||||
#ifdef FLAG_PORTABLE_MODE_SUPPORT
|
||||
QString portableConfigDirPath = QDir(QCoreApplication::applicationDirPath()).absoluteFilePath("data");
|
||||
QFileInfo portableConfigDirInfo(portableConfigDirPath);
|
||||
if (portableConfigDirInfo.exists() && portableConfigDirInfo.isDir() && portableConfigDirInfo.isWritable()) {
|
||||
// we can use it.
|
||||
configPath = portableConfigDirPath;
|
||||
}
|
||||
#endif // FLAG_PORTABLE_MODE_SUPPORT
|
||||
|
||||
// %LOCALAPPDATA% under Windows.
|
||||
if (configPath.isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user