diff --git a/src/plugins/cpaster/frontend/argumentscollector.cpp b/src/plugins/cpaster/frontend/argumentscollector.cpp index 5295268a599..d6950a1626a 100644 --- a/src/plugins/cpaster/frontend/argumentscollector.cpp +++ b/src/plugins/cpaster/frontend/argumentscollector.cpp @@ -30,6 +30,7 @@ #include "argumentscollector.h" #include +#include static QString pasteRequestString() { return QLatin1String("paste"); } static QString listProtocolsRequestString() { return QLatin1String("list-protocols"); } @@ -69,25 +70,20 @@ bool ArgumentsCollector::collect(const QStringList &args) QString ArgumentsCollector::usageString() const { - QString usage = tr("Usage:"); - usage += QLatin1String("\n\t"); - usage += tr("%1 [ ]") + QString usage = QString::fromLatin1("Usage:\n\t%1 [ ]\n\t") .arg(QFileInfo(QCoreApplication::applicationFilePath()).fileName()); - usage += QLatin1String("\n\t"); - usage += tr("Possible requests: \"%1\", \"%2\", \"%3\"") + usage += QString::fromLatin1("Possible requests: \"%1\", \"%2\", \"%3\"\n\t") .arg(pasteRequestString(), listProtocolsRequestString(), helpRequestString()); - usage += QLatin1String("\n\t"); - usage += tr("Possible options for request \"%1\": \"%2 \" (default: stdin), " - "\"%3 \"") + usage += QString::fromLatin1("Possible options for request \"%1\": \"%2 \" (default: stdin), " + "\"%3 \"\n") .arg(pasteRequestString(), pasteFileOptionString(), pasteProtocolOptionString()); - usage += QLatin1Char('\n'); return usage; } void ArgumentsCollector::setRequest() { if (m_arguments.isEmpty()) - throw ArgumentErrorException(tr("No request given")); + throw ArgumentErrorException(QLatin1String("No request given")); const QString requestString = m_arguments.takeFirst(); if (requestString == pasteRequestString()) m_requestType = RequestTypePaste; @@ -96,7 +92,7 @@ void ArgumentsCollector::setRequest() else if (requestString == helpRequestString()) m_requestType = RequestTypeHelp; else - throw ArgumentErrorException(tr("Unknown request \"%1\"").arg(requestString)); + throw ArgumentErrorException(QString::fromLatin1("Unknown request \"%1\"").arg(requestString)); } void ArgumentsCollector::setPasteOptions() @@ -106,15 +102,15 @@ void ArgumentsCollector::setPasteOptions() continue; if (checkAndSetOption(pasteProtocolOptionString(), m_protocol)) { if (!m_availableProtocols.contains(m_protocol)) - throw ArgumentErrorException(tr("Unknown protocol \"%1\"").arg(m_protocol)); + throw ArgumentErrorException(QString::fromLatin1("Unknown protocol \"%1\"").arg(m_protocol)); continue; } - throw ArgumentErrorException(tr("Invalid option \"%1\" for request \"%2\"") + throw ArgumentErrorException(QString::fromLatin1("Invalid option \"%1\" for request \"%2\"") .arg(m_arguments.first(), pasteRequestString())); } if (m_protocol.isEmpty()) - throw ArgumentErrorException(tr("No protocol given")); + throw ArgumentErrorException(QLatin1String("No protocol given")); } bool ArgumentsCollector::checkAndSetOption(const QString &optionString, QString &optionValue) @@ -123,10 +119,10 @@ bool ArgumentsCollector::checkAndSetOption(const QString &optionString, QString return false; if (!optionValue.isEmpty()) - throw ArgumentErrorException(tr("option \"%1\" was given twice").arg(optionString)); + throw ArgumentErrorException(QString::fromLatin1("option \"%1\" was given twice").arg(optionString)); m_arguments.removeFirst(); if (m_arguments.isEmpty()) { - throw ArgumentErrorException(tr("Option \"%1\" requires an argument") + throw ArgumentErrorException(QString::fromLatin1("Option \"%1\" requires an argument") .arg(optionString)); } optionValue = m_arguments.takeFirst(); diff --git a/src/plugins/cpaster/frontend/argumentscollector.h b/src/plugins/cpaster/frontend/argumentscollector.h index 60f674467d4..83ddfb7eab6 100644 --- a/src/plugins/cpaster/frontend/argumentscollector.h +++ b/src/plugins/cpaster/frontend/argumentscollector.h @@ -30,12 +30,10 @@ #ifndef ARGUMENTSCOLLECTOR_H #define ARGUMENTSCOLLECTOR_H -#include #include class ArgumentsCollector { - Q_DECLARE_TR_FUNCTIONS(ArgumentsCollector) public: ArgumentsCollector(const QStringList &availableProtocols); bool collect(const QStringList &args); // Application is already removed. diff --git a/src/plugins/cpaster/frontend/main.cpp b/src/plugins/cpaster/frontend/main.cpp index e79dab4378e..11b8f8f9f40 100644 --- a/src/plugins/cpaster/frontend/main.cpp +++ b/src/plugins/cpaster/frontend/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include