void showVersion()
{
- const char *binaryName = APPLICATION_EXECUTABLE "cmd";
- std::cout << binaryName << " version " << qPrintable(Theme::instance()->version()) << std::endl;
+ std::cout << qPrintableUtf8(Theme::instance()->versionSwitchOutput());
exit(0);
}
void Application::showVersion()
{
- QString helpText;
- QTextStream stream(&helpText);
- stream << _theme->appName().toLatin1().constData()
- << QLatin1String(" version ")
- << _theme->version().toLatin1().constData() << endl;
-#ifdef GIT_SHA1
- stream << "Git revision " << GIT_SHA1 << endl;
-#endif
- stream << "Using Qt " << qVersion() << ", built against Qt " << QT_VERSION_STR << endl;
- stream << "Using '" << QSslSocket::sslLibraryVersionString() << "'" << endl;
-
- displayHelpText(helpText);
+ displayHelpText(Theme::instance()->versionSwitchOutput());
}
void Application::showHint(std::string errorHint)
return "UBntmLjC2yYCeHwsyj73Uwo9TAaecAetRwMw0xYcvNL9yRdLSUi0hUAHfvCHFeFh";
}
+QString Theme::versionSwitchOutput() const
+{
+ QString helpText;
+ QTextStream stream(&helpText);
+ stream << appName().toLatin1().constData()
+ << QLatin1String(" version ")
+ << version().toLatin1().constData() << endl;
+#ifdef GIT_SHA1
+ stream << "Git revision " << GIT_SHA1 << endl;
+#endif
+ stream << "Using Qt " << qVersion() << ", built against Qt " << QT_VERSION_STR << endl;
+ stream << "Using '" << QSslSocket::sslLibraryVersionString() << "'" << endl;
+ return helpText;
+}
+
} // end namespace client
virtual QString oauthClientId() const;
virtual QString oauthClientSecret() const;
+ /**
+ * @brief What should be output for the --version command line switch.
+ *
+ * By default, it's a combination of appName(), version(), the GIT SHA1 and some
+ * important dependency versions.
+ */
+ virtual QString versionSwitchOutput() const;
+
protected:
#ifndef TOKEN_AUTH_ONLY