mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 18:28:18 +03:00
Ensure the profile path is pointing to a directory
Closes #20513. PR #20519.
This commit is contained in:
parent
cce1290c0c
commit
18296b2f75
1 changed files with 2 additions and 5 deletions
|
@ -264,11 +264,8 @@ Application::Application(int &argc, char **argv)
|
||||||
Logger::initInstance();
|
Logger::initInstance();
|
||||||
|
|
||||||
const auto portableProfilePath = Path(QCoreApplication::applicationDirPath()) / DEFAULT_PORTABLE_MODE_PROFILE_DIR;
|
const auto portableProfilePath = Path(QCoreApplication::applicationDirPath()) / DEFAULT_PORTABLE_MODE_PROFILE_DIR;
|
||||||
const bool portableModeEnabled = m_commandLineArgs.profileDir.isEmpty() && portableProfilePath.exists();
|
const bool portableModeEnabled = m_commandLineArgs.profileDir.isEmpty() && Utils::Fs::isDir(portableProfilePath);
|
||||||
|
const Path profileDir = portableModeEnabled ? portableProfilePath : m_commandLineArgs.profileDir;
|
||||||
const Path profileDir = portableModeEnabled
|
|
||||||
? portableProfilePath
|
|
||||||
: m_commandLineArgs.profileDir;
|
|
||||||
Profile::initInstance(profileDir, m_commandLineArgs.configurationName,
|
Profile::initInstance(profileDir, m_commandLineArgs.configurationName,
|
||||||
(m_commandLineArgs.relativeFastresumePaths || portableModeEnabled));
|
(m_commandLineArgs.relativeFastresumePaths || portableModeEnabled));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue