From 8bfd333c60c174fdd3b853d2d3df27516060e2e9 Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sat, 27 Dec 2014 21:58:37 +0200 Subject: [PATCH] Touch up previous commit. --- src/main.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index dafc60a23..840e93e3b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -101,7 +101,7 @@ void sigsegvHandler(int); void sigabrtHandler(int); #endif -struct QbtCommandLineParameters +struct QBtCommandLineParameters { bool showHelp; #ifndef Q_OS_WIN @@ -115,7 +115,7 @@ struct QbtCommandLineParameters int webUiPort; QStringList torrents; - QbtCommandLineParameters() + QBtCommandLineParameters() : showHelp(false) #ifndef Q_OS_WIN , showVersion(false) @@ -130,15 +130,14 @@ struct QbtCommandLineParameters } }; -QbtCommandLineParameters parseCommandLine(); - #ifndef DISABLE_GUI void showSplashScreen(); #endif void displayVersion(); -void displayUsage(QString prg_name = QLatin1String("qbittorrent")); +void displayUsage(const QString &prg_name); bool userAgreesWithLegalNotice(); -void displayBadArgMessage(QString message); +void displayBadArgMessage(const QString &message); +QBtCommandLineParameters parseCommandLine(); // Main int main(int argc, char *argv[]) @@ -153,7 +152,7 @@ int main(int argc, char *argv[]) QObject::connect(app.data(), SIGNAL(messageReceived(const QString &)), messagesCollector, SLOT(collectMessage(const QString &))); - const QbtCommandLineParameters params = parseCommandLine(); + const QBtCommandLineParameters params = parseCommandLine(); #ifndef Q_OS_WIN if (params.showVersion) { @@ -285,9 +284,9 @@ int main(int argc, char *argv[]) return ret; } -QbtCommandLineParameters parseCommandLine() +QBtCommandLineParameters parseCommandLine() { - QbtCommandLineParameters result; + QBtCommandLineParameters result; QStringList appArguments = qApp->arguments(); for (int i = 1; i < appArguments.size(); ++i) { @@ -404,7 +403,7 @@ void displayVersion() std::cout << qPrintable(qApp->applicationName()) << " " << VERSION << std::endl; } -QString makeUsage(QString prg_name) +QString makeUsage(const QString &prg_name) { QString text; @@ -439,7 +438,7 @@ QString makeUsage(QString prg_name) return text; } -void displayUsage(QString prg_name) +void displayUsage(const QString& prg_name) { #ifndef Q_OS_WIN std::cout << qPrintable(makeUsage(prg_name)) << std::endl; @@ -451,7 +450,7 @@ void displayUsage(QString prg_name) #endif } -void displayBadArgMessage(QString message) +void displayBadArgMessage(const QString& message) { QString help = QObject::tr("Run application with -h option to read about command line parameters."); #ifdef Q_OS_WIN