mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 03:06:37 +03:00
Merge pull request #12348 from glassez/fix-multi-inst
Prevent multiple instances for the same app config
This commit is contained in:
commit
bc159121dc
1 changed files with 6 additions and 2 deletions
|
@ -149,8 +149,12 @@ Application::Application(int &argc, char **argv)
|
|||
const QString profileDir = portableModeEnabled
|
||||
? QDir(QCoreApplication::applicationDirPath()).absoluteFilePath(DEFAULT_PORTABLE_MODE_PROFILE_DIR)
|
||||
: m_commandLineArgs.profileDir;
|
||||
const QString appId = QLatin1String("qBittorrent-") + Utils::Misc::getUserIDString() + '@' + profileDir
|
||||
+ (m_commandLineArgs.configurationName.isEmpty() ? QString {} : ('/' + m_commandLineArgs.configurationName));
|
||||
#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,
|
||||
|
|
Loading…
Reference in a new issue