mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 13:25:52 +03:00
Move the --version output text to Theme #5957
Extracted and adjusted from packaging.diff by @jnweiger and @dschmidt
This commit is contained in:
parent
706c68f69c
commit
844bfc5f25
4 changed files with 25 additions and 14 deletions
|
@ -196,8 +196,7 @@ void help()
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -487,18 +487,7 @@ void Application::showHelp()
|
|||
|
||||
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)
|
||||
|
|
|
@ -505,5 +505,20 @@ QString Theme::oauthClientSecret() const
|
|||
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
|
||||
|
|
|
@ -327,6 +327,14 @@ public:
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue