Browse Source

Fix encoding of version string

Olivier Goffart 8 years ago
parent
commit
d59c146488
3 changed files with 9 additions and 9 deletions
  1. 1 1
      src/cmd/cmd.cpp
  2. 3 3
      src/gui/application.cpp
  3. 5 5
      src/libsync/theme.cpp

+ 1 - 1
src/cmd/cmd.cpp

@@ -196,7 +196,7 @@ void help()
 
 void showVersion()
 {
-    std::cout << qPrintableUtf8(Theme::instance()->versionSwitchOutput());
+    std::cout << qUtf8Printable(Theme::instance()->versionSwitchOutput());
     exit(0);
 }
 

+ 3 - 3
src/gui/application.cpp

@@ -460,7 +460,7 @@ static void displayHelpText(QString t) // No console on Windows.
 
 static void displayHelpText(const QString &t)
 {
-    std::cout << qPrintable(t);
+    std::cout << qUtf8Printable(t);
 }
 #endif
 
@@ -469,9 +469,9 @@ void Application::showHelp()
     setHelp();
     QString helpText;
     QTextStream stream(&helpText);
-    stream << _theme->appName().toLatin1().constData()
+    stream << _theme->appName()
            << QLatin1String(" version ")
-           << _theme->version().toLatin1().constData() << endl;
+           << _theme->version() << endl;
 
     stream << QLatin1String("File synchronisation desktop utility.") << endl
            << endl

+ 5 - 5
src/libsync/theme.cpp

@@ -92,17 +92,17 @@ QString Theme::statusHeaderText(SyncResult::Status status) const
 
 QString Theme::appNameGUI() const
 {
-    return QLatin1String(APPLICATION_NAME);
+    return APPLICATION_NAME;
 }
 
 QString Theme::appName() const
 {
-    return QLatin1String(APPLICATION_SHORTNAME);
+    return APPLICATION_SHORTNAME;
 }
 
 QString Theme::version() const
 {
-    return QString::fromLocal8Bit(MIRALL_VERSION_STRING);
+    return MIRALL_VERSION_STRING;
 }
 
 #ifndef TOKEN_AUTH_ONLY
@@ -509,9 +509,9 @@ QString Theme::versionSwitchOutput() const
 {
     QString helpText;
     QTextStream stream(&helpText);
-    stream << appName().toLatin1().constData()
+    stream << appName()
            << QLatin1String(" version ")
-           << version().toLatin1().constData() << endl;
+           << version() << endl;
 #ifdef GIT_SHA1
     stream << "Git revision " << GIT_SHA1 << endl;
 #endif