mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-22 16:37:21 -06:00
Improve command line parameters dispatching
Encapsulate parameters dispatching in Application class. Avoid serializing parameters when it is not necessary. PR #18469.
This commit is contained in:
committed by
GitHub
parent
09e58df03f
commit
0dcbf9f698
@@ -96,10 +96,10 @@ public:
|
||||
Application(int &argc, char **argv);
|
||||
~Application() override;
|
||||
|
||||
int exec(const QStringList ¶ms);
|
||||
int exec();
|
||||
|
||||
bool isRunning();
|
||||
bool sendParams(const QStringList ¶ms);
|
||||
bool callMainInstance();
|
||||
const QBtCommandLineParameters &commandLineArgs() const;
|
||||
|
||||
// FileLogger properties
|
||||
@@ -149,16 +149,8 @@ private slots:
|
||||
#endif
|
||||
|
||||
private:
|
||||
struct AddTorrentParams
|
||||
{
|
||||
QStringList torrentSources;
|
||||
BitTorrent::AddTorrentParams torrentParams;
|
||||
std::optional<bool> skipTorrentDialog;
|
||||
};
|
||||
|
||||
void initializeTranslation();
|
||||
AddTorrentParams parseParams(const QStringList ¶ms) const;
|
||||
void processParams(const AddTorrentParams ¶ms);
|
||||
void processParams(const QBtCommandLineParameters ¶ms);
|
||||
void runExternalProgram(const QString &programTemplate, const BitTorrent::Torrent *torrent) const;
|
||||
void sendNotificationEmail(const BitTorrent::Torrent *torrent);
|
||||
|
||||
@@ -190,7 +182,7 @@ private:
|
||||
QTranslator m_qtTranslator;
|
||||
QTranslator m_translator;
|
||||
|
||||
QList<AddTorrentParams> m_paramsQueue;
|
||||
QList<QBtCommandLineParameters> m_paramsQueue;
|
||||
|
||||
SettingValue<bool> m_storeFileLoggerEnabled;
|
||||
SettingValue<bool> m_storeFileLoggerBackup;
|
||||
|
||||
Reference in New Issue
Block a user