mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-06 15:42:32 -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
@@ -35,6 +35,7 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
#include "base/bittorrent/addtorrentparams.h"
|
||||
#include "base/exceptions.h"
|
||||
#include "base/path.h"
|
||||
|
||||
@@ -42,32 +43,29 @@ class QProcessEnvironment;
|
||||
|
||||
struct QBtCommandLineParameters
|
||||
{
|
||||
bool showHelp;
|
||||
bool relativeFastresumePaths;
|
||||
bool skipChecking;
|
||||
bool sequential;
|
||||
bool firstLastPiecePriority;
|
||||
bool showHelp = false;
|
||||
bool relativeFastresumePaths = false;
|
||||
#if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
|
||||
bool showVersion;
|
||||
bool showVersion = false;
|
||||
#endif
|
||||
#ifndef DISABLE_GUI
|
||||
bool noSplash;
|
||||
bool noSplash = false;
|
||||
#elif !defined(Q_OS_WIN)
|
||||
bool shouldDaemonize;
|
||||
bool shouldDaemonize = false;
|
||||
#endif
|
||||
int webUiPort;
|
||||
int torrentingPort;
|
||||
std::optional<bool> addPaused;
|
||||
int webUiPort = -1;
|
||||
int torrentingPort = -1;
|
||||
std::optional<bool> skipDialog;
|
||||
QStringList torrents;
|
||||
Path profileDir;
|
||||
QString configurationName;
|
||||
Path savePath;
|
||||
QString category;
|
||||
|
||||
QStringList torrentSources;
|
||||
BitTorrent::AddTorrentParams addTorrentParams;
|
||||
|
||||
QString unknownParameter;
|
||||
|
||||
QBtCommandLineParameters() = default;
|
||||
explicit QBtCommandLineParameters(const QProcessEnvironment &);
|
||||
QStringList paramList() const;
|
||||
};
|
||||
|
||||
class CommandLineParameterError : public RuntimeError
|
||||
|
||||
Reference in New Issue
Block a user