mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Create lock file in config folder instead of temp folder
Some linux distros seem to alter TMPDIR environment variable and therefore hamper qbt ability to find the lock files. So use config folder instead of TMPDIR folder to create/locate the lock files. Note that this change will also make qbt become one instance per-user instead of one instance per-system. Closes #15646.
This commit is contained in:
parent
40f2718265
commit
a5c531f0a4
6 changed files with 29 additions and 70 deletions
|
@ -154,17 +154,11 @@ Application::Application(int &argc, char **argv)
|
|||
const QString profileDir = portableModeEnabled
|
||||
? QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(DEFAULT_PORTABLE_MODE_PROFILE_DIR)
|
||||
: m_commandLineArgs.profileDir;
|
||||
#ifdef Q_OS_WIN
|
||||
const QString instanceId = (profileDir + (m_commandLineArgs.configurationName.isEmpty() ? QString {} : ('/' + m_commandLineArgs.configurationName))).toLower();
|
||||
#else
|
||||
const QString instanceId = profileDir + (m_commandLineArgs.configurationName.isEmpty() ? QString {} : ('/' + m_commandLineArgs.configurationName));
|
||||
#endif
|
||||
const QString appId = QLatin1String("qBittorrent-") + Utils::Misc::getUserIDString() + '@' + instanceId;
|
||||
m_instanceManager = new ApplicationInstanceManager {appId, this};
|
||||
|
||||
Profile::initInstance(profileDir, m_commandLineArgs.configurationName,
|
||||
(m_commandLineArgs.relativeFastresumePaths || portableModeEnabled));
|
||||
|
||||
m_instanceManager = new ApplicationInstanceManager {Profile::instance()->location(SpecialFolder::Config), this};
|
||||
|
||||
Logger::initInstance();
|
||||
SettingsStorage::initInstance();
|
||||
Preferences::initInstance();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue