mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Allow single app instance per configuration
This commit is contained in:
@@ -78,7 +78,6 @@ Q_IMPORT_PLUGIN(QICOPlugin)
|
||||
|
||||
#include "base/preferences.h"
|
||||
#include "base/profile.h"
|
||||
#include "base/utils/misc.h"
|
||||
#include "application.h"
|
||||
#include "cmdoptions.h"
|
||||
#include "upgrade.h"
|
||||
@@ -135,11 +134,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
try {
|
||||
// Create Application
|
||||
const QString appId = QLatin1String("qBittorrent-") + Utils::Misc::getUserIDString();
|
||||
auto app = std::make_unique<Application>(appId, argc, argv);
|
||||
auto app = std::make_unique<Application>(argc, argv);
|
||||
|
||||
const QBtCommandLineParameters params = app->commandLineArgs();
|
||||
|
||||
if (!params.unknownParameter.isEmpty()) {
|
||||
throw CommandLineParameterError(QObject::tr("%1 is an unknown command line parameter.",
|
||||
"--random-parameter is an unknown command line parameter.")
|
||||
@@ -258,7 +255,7 @@ int main(int argc, char *argv[])
|
||||
if (params.shouldDaemonize) {
|
||||
app.reset(); // Destroy current application
|
||||
if (daemon(1, 0) == 0) {
|
||||
app = std::make_unique<Application>(appId, argc, argv);
|
||||
app = std::make_unique<Application>(argc, argv);
|
||||
if (app->isRunning()) {
|
||||
// Another instance had time to start.
|
||||
return EXIT_FAILURE;
|
||||
|
||||
Reference in New Issue
Block a user