mirror of
https://github.com/jellyfin/jellyfin-desktop.git
synced 2026-10-26 16:45:24 +00:00
Fix portable mode
This commit is contained in:
1 parent
c1c80a5fc4
commit
ec3e4d101d
2 files changed
+7
-5
No files matched your search
+5
-3
@@ -226,6 +226,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Now parse the command line.
|
||||
parser.process(arguments);
|
||||
|
||||
// Detect portable mode while QCoreApplication exists (needed for applicationDirPath)
|
||||
Paths::detectAndEnablePortableMode();
|
||||
}
|
||||
|
||||
if (parser.isSet("help"))
|
||||
@@ -243,10 +246,9 @@ int main(int argc, char *argv[])
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// Check for portable mode (marker file next to exe)
|
||||
if (Paths::detectAndEnablePortableMode())
|
||||
// Set QSettings path for portable mode
|
||||
if (Paths::isPortableMode())
|
||||
{
|
||||
// Portable mode sets its own paths, skip config-dir
|
||||
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope,
|
||||
Paths::globalDataDir());
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
#include <QDir>
|
||||
#include <QStandardPaths>
|
||||
#include <QCoreApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QtGui/qguiapplication.h>
|
||||
#include <QDebug>
|
||||
#include "Names.h"
|
||||
#include "Version.h"
|
||||
@@ -41,7 +41,7 @@ bool Paths::isPortableMode()
|
||||
bool Paths::detectAndEnablePortableMode()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
QString appDir = QGuiApplication::applicationDirPath();
|
||||
QString appDir = QCoreApplication::applicationDirPath();
|
||||
|
||||
// Check for portable marker file
|
||||
if (QFile::exists(appDir + "/portable") || QFile::exists(appDir + "/portable.txt"))
|
||||
|
||||
Reference in new issue
Block a user