qBittorrent
QBtCommandLineParameters Struct Reference

#include <cmdoptions.h>

Public Member Functions

 QBtCommandLineParameters (const QProcessEnvironment &)
 
QStringList paramList () const
 

Public Attributes

bool showHelp
 
bool relativeFastresumePaths
 
bool skipChecking
 
bool sequential
 
bool firstLastPiecePriority
 
bool showVersion
 
bool noSplash
 
int webUiPort
 
std::optional< bool > addPaused
 
std::optional< bool > skipDialog
 
QStringList torrents
 
QString profileDir
 
QString configurationName
 
QString savePath
 
QString category
 
QString unknownParameter
 

Detailed Description

Definition at line 42 of file cmdoptions.h.

Constructor & Destructor Documentation

◆ QBtCommandLineParameters()

QBtCommandLineParameters::QBtCommandLineParameters ( const QProcessEnvironment &  env)
explicit

Definition at line 339 of file cmdoptions.cpp.

340  : showHelp(false)
345 #if !defined(Q_OS_WIN) || defined(DISABLE_GUI)
346  , showVersion(false)
347 #endif
348 #ifndef DISABLE_GUI
350 #elif !defined(Q_OS_WIN)
351  , shouldDaemonize(DAEMON_OPTION.value(env))
352 #endif
353  , webUiPort(WEBUI_PORT_OPTION.value(env, -1))
360 {
361 }
bool value(const QProcessEnvironment &env) const
Definition: cmdoptions.cpp:120
std::optional< bool > value(const QString &arg) const
Definition: cmdoptions.cpp:257
constexpr const StringOption CATEGORY_OPTION
Definition: cmdoptions.cpp:333
constexpr const StringOption SAVE_PATH_OPTION
Definition: cmdoptions.cpp:330
constexpr const TriStateBoolOption SKIP_DIALOG_OPTION
Definition: cmdoptions.cpp:336
constexpr const BoolOption NO_SPLASH_OPTION
Definition: cmdoptions.cpp:324
constexpr const BoolOption RELATIVE_FASTRESUME
Definition: cmdoptions.cpp:329
constexpr const StringOption PROFILE_OPTION
Definition: cmdoptions.cpp:327
constexpr const IntOption WEBUI_PORT_OPTION
Definition: cmdoptions.cpp:326
constexpr const BoolOption SEQUENTIAL_OPTION
Definition: cmdoptions.cpp:334
constexpr const BoolOption FIRST_AND_LAST_OPTION
Definition: cmdoptions.cpp:335
constexpr const BoolOption SKIP_HASH_CHECK_OPTION
Definition: cmdoptions.cpp:332
constexpr const StringOption CONFIGURATION_OPTION
Definition: cmdoptions.cpp:328
constexpr const TriStateBoolOption PAUSED_OPTION
Definition: cmdoptions.cpp:331
std::optional< bool > addPaused
Definition: cmdoptions.h:58
std::optional< bool > skipDialog
Definition: cmdoptions.h:59
QString value(const QString &arg) const
Definition: cmdoptions.cpp:156

Member Function Documentation

◆ paramList()

QStringList QBtCommandLineParameters::paramList ( ) const

Definition at line 363 of file cmdoptions.cpp.

364 {
365  QStringList result;
366  // Because we're passing a string list to the currently running
367  // qBittorrent process, we need some way of passing along the options
368  // the user has specified. Here we place special strings that are
369  // almost certainly not going to collide with a file path or URL
370  // specified by the user, and placing them at the beginning of the
371  // string list so that they will be processed before the list of
372  // torrent paths or URLs.
373 
374  if (!savePath.isEmpty())
375  result.append(QLatin1String("@savePath=") + savePath);
376 
377  if (addPaused.has_value())
378  result.append(*addPaused ? QLatin1String {"@addPaused=1"} : QLatin1String {"@addPaused=0"});
379 
380  if (skipChecking)
381  result.append(QLatin1String("@skipChecking"));
382 
383  if (!category.isEmpty())
384  result.append(QLatin1String("@category=") + category);
385 
386  if (sequential)
387  result.append(QLatin1String("@sequential"));
388 
390  result.append(QLatin1String("@firstLastPiecePriority"));
391 
392  if (skipDialog.has_value())
393  result.append(*skipDialog ? QLatin1String {"@skipDialog=1"} : QLatin1String {"@skipDialog=0"});
394 
395  result += torrents;
396  return result;
397 }

References addPaused, category, firstLastPiecePriority, savePath, sequential, skipChecking, skipDialog, and torrents.

Referenced by main().

Here is the caller graph for this function:

Member Data Documentation

◆ addPaused

std::optional<bool> QBtCommandLineParameters::addPaused

Definition at line 58 of file cmdoptions.h.

Referenced by paramList().

◆ category

QString QBtCommandLineParameters::category

Definition at line 64 of file cmdoptions.h.

Referenced by paramList().

◆ configurationName

QString QBtCommandLineParameters::configurationName

Definition at line 62 of file cmdoptions.h.

Referenced by Application::Application().

◆ firstLastPiecePriority

bool QBtCommandLineParameters::firstLastPiecePriority

Definition at line 48 of file cmdoptions.h.

Referenced by paramList().

◆ noSplash

bool QBtCommandLineParameters::noSplash

Definition at line 53 of file cmdoptions.h.

Referenced by main().

◆ profileDir

QString QBtCommandLineParameters::profileDir

Definition at line 61 of file cmdoptions.h.

Referenced by Application::Application().

◆ relativeFastresumePaths

bool QBtCommandLineParameters::relativeFastresumePaths

Definition at line 45 of file cmdoptions.h.

Referenced by Application::Application().

◆ savePath

QString QBtCommandLineParameters::savePath

Definition at line 63 of file cmdoptions.h.

Referenced by paramList().

◆ sequential

bool QBtCommandLineParameters::sequential

Definition at line 47 of file cmdoptions.h.

Referenced by paramList().

◆ showHelp

bool QBtCommandLineParameters::showHelp

Definition at line 44 of file cmdoptions.h.

Referenced by main().

◆ showVersion

bool QBtCommandLineParameters::showVersion

Definition at line 50 of file cmdoptions.h.

Referenced by main().

◆ skipChecking

bool QBtCommandLineParameters::skipChecking

Definition at line 46 of file cmdoptions.h.

Referenced by paramList().

◆ skipDialog

std::optional<bool> QBtCommandLineParameters::skipDialog

Definition at line 59 of file cmdoptions.h.

Referenced by paramList().

◆ torrents

QStringList QBtCommandLineParameters::torrents

Definition at line 60 of file cmdoptions.h.

Referenced by paramList().

◆ unknownParameter

QString QBtCommandLineParameters::unknownParameter

Definition at line 65 of file cmdoptions.h.

Referenced by main().

◆ webUiPort

int QBtCommandLineParameters::webUiPort

Definition at line 57 of file cmdoptions.h.

Referenced by Application::Application().


The documentation for this struct was generated from the following files: