mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 08:27:24 -06:00
Implement "Application instances manager"
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2015, 2019 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2006 Christophe Dumez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -27,16 +27,15 @@
|
||||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
#pragma once
|
||||
|
||||
#include <QPointer>
|
||||
#include <QStringList>
|
||||
#include <QTranslator>
|
||||
|
||||
#ifndef DISABLE_GUI
|
||||
#include "qtsingleapplication.h"
|
||||
typedef QtSingleApplication BaseApplication;
|
||||
#include <QApplication>
|
||||
using BaseApplication = QApplication;
|
||||
class MainWindow;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
@@ -44,8 +43,8 @@ class QSessionManager;
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
#else
|
||||
#include "qtsinglecoreapplication.h"
|
||||
typedef QtSingleCoreApplication BaseApplication;
|
||||
#include <QCoreApplication>
|
||||
using BaseApplication = QCoreApplication;
|
||||
#endif // DISABLE_GUI
|
||||
|
||||
#include "base/types.h"
|
||||
@@ -55,6 +54,7 @@ typedef QtSingleCoreApplication BaseApplication;
|
||||
class WebUI;
|
||||
#endif
|
||||
|
||||
class ApplicationInstanceManager;
|
||||
class FileLogger;
|
||||
|
||||
namespace BitTorrent
|
||||
@@ -77,9 +77,7 @@ public:
|
||||
Application(const QString &id, int &argc, char **argv);
|
||||
~Application() override;
|
||||
|
||||
#if (defined(Q_OS_WIN) && !defined(DISABLE_GUI))
|
||||
bool isRunning();
|
||||
#endif
|
||||
int exec(const QStringList ¶ms);
|
||||
bool sendParams(const QStringList ¶ms);
|
||||
|
||||
@@ -122,6 +120,7 @@ private slots:
|
||||
#endif
|
||||
|
||||
private:
|
||||
ApplicationInstanceManager *m_instanceManager;
|
||||
bool m_running;
|
||||
ShutdownDialogAction m_shutdownAct;
|
||||
QBtCommandLineParameters m_commandLineArgs;
|
||||
@@ -147,5 +146,3 @@ private:
|
||||
void sendNotificationEmail(const BitTorrent::TorrentHandle *torrent);
|
||||
void validateCommandLineParameters();
|
||||
};
|
||||
|
||||
#endif // APPLICATION_H
|
||||
|
||||
Reference in New Issue
Block a user