[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kleopatra] src: Add more QStringLiteral
From:       Laurent Montel <null () kde ! org>
Date:       2018-09-05 19:41:32
Message-ID: E1fxdgC-0006EP-Ni () code ! kde ! org
[Download RAW message or body]

Git commit 198fb3a2819b6b228c1e4c32d9fa7fc84ee181c0 by Laurent Montel.
Committed on 05/09/2018 at 19:41.
Pushed by mlaurent into branch 'master'.

Add more QStringLiteral

M  +1    -1    src/aboutdata.cpp
M  +2    -2    src/commands/genrevokecommand.cpp
M  +2    -2    src/commands/keytocardcommand.cpp
M  +1    -1    src/crypto/autodecryptverifyfilescontroller.cpp
M  +2    -2    src/crypto/gui/resultitemwidget.cpp
M  +2    -2    src/crypto/gui/unknownrecipientwidget.cpp
M  +5    -5    src/dialogs/exportdialog.cpp
M  +2    -2    src/dialogs/updatenotification.cpp
M  +3    -3    src/kleopatraapplication.cpp
M  +7    -7    src/smartcard/openpgpcard.cpp

https://commits.kde.org/kleopatra/198fb3a2819b6b228c1e4c32d9fa7fc84ee181c0

diff --git a/src/aboutdata.cpp b/src/aboutdata.cpp
index ece78d1b..9c5775c9 100644
--- a/src/aboutdata.cpp
+++ b/src/aboutdata.cpp
@@ -92,7 +92,7 @@ AboutData::AboutData()
                  QLatin1String(kleopatra_version), i18n(description), \
                KAboutLicense::GPL,
                  i18n("(c) 2002 Steffen\u00A0Hansen, Matthias\u00A0Kalle\u00A0" \
                "Dalheimer, Klar\u00E4lvdalens\u00A0" "Datakonsult\u00A0" "AB\n"
                       "(c) 2004, 2007, 2008, 2009 Marc\u00A0Mutz, \
                Klar\u00E4lvdalens\u00A0" "Datakonsult\u00A0" "AB") +
-                 '\n' + i18n("(c) 2010-2018 The Kleopatra developers")
+                 QLatin1Char('\n') + i18n("(c) 2010-2018 The Kleopatra developers")
 #ifdef Q_OS_WIN
                  , i18n("<a href=https://www.gpg4win.org>Visit the Gpg4win \
homepage</a>")  #endif
diff --git a/src/commands/genrevokecommand.cpp b/src/commands/genrevokecommand.cpp
index 611ee72a..d8f8edfb 100644
--- a/src/commands/genrevokecommand.cpp
+++ b/src/commands/genrevokecommand.cpp
@@ -133,7 +133,7 @@ void GenRevokeCommand::doStart()
             return;
         }
         if (!mOutputFileName.endsWith(QLatin1String(".rev"))) {
-            mOutputFileName += ".rev";
+            mOutputFileName += QLatin1String(".rev");
         }
         if (QFileInfo(mOutputFileName).exists()) {
             auto sel = KMessageBox::questionYesNo(d->parentWidgetOrView(), i18n("The \
file <b>%1</b> already exists.\n" @@ -182,7 +182,7 @@ QStringList \
GenRevokeCommand::arguments() const  const Key key = d->key();
     QStringList result;
 
-    result << gpgPath() << "--command-fd" << "0" << "--status-fd" << "1"
+    result << gpgPath() << QStringLiteral("--command-fd") << QStringLiteral("0") << \
QStringLiteral("--status-fd") << QStringLiteral("1")  << QStringLiteral("-o") << \
mOutputFileName  << QStringLiteral("--gen-revoke")
            << QLatin1String(key.primaryFingerprint());
diff --git a/src/commands/keytocardcommand.cpp b/src/commands/keytocardcommand.cpp
index acc294dc..7c6b0e9e 100644
--- a/src/commands/keytocardcommand.cpp
+++ b/src/commands/keytocardcommand.cpp
@@ -150,7 +150,7 @@ private:
             }
         }
         if (!cardFound) {
-            error(i18n("Failed to find the card with the serial number: %1", \
mSerial.c_str())); +            error(i18n("Failed to find the card with the serial \
number: %1", QString::fromStdString(mSerial)));  finished();
             return;
         }
@@ -172,7 +172,7 @@ private:
         const auto timestamp = time.toString(QStringLiteral("yyyyMMdd'T'HHmmss"));
 #ifdef GPGME_SUBKEY_HAS_KEYGRIP
         const QString cmd = QStringLiteral("KEYTOCARD --force %1 %2 OPENPGP.%3 \
                %4").arg(mKey.keyGrip())
-                                                                                   \
.arg(mSerial.c_str()) +                                                               \
                .arg(QString::fromStdString(mSerial))
                                                                                    \
                .arg(slot)
                                                                                    \
                .arg(timestamp);
         ReaderStatus::mutableInstance()->startSimpleTransaction(cmd.toUtf8(), \
                q_func(), "keyToCardDone");
diff --git a/src/crypto/autodecryptverifyfilescontroller.cpp \
b/src/crypto/autodecryptverifyfilescontroller.cpp index 1da47447..adf9b445 100644
--- a/src/crypto/autodecryptverifyfilescontroller.cpp
+++ b/src/crypto/autodecryptverifyfilescontroller.cpp
@@ -419,7 +419,7 @@ std::vector< std::shared_ptr<Task> > \
AutoDecryptVerifyFilesController::Private::  
             if (FileOperationsPreferences().dontUseTmpDir()) {
                 if (!m_workDir) {
-                    m_workDir = new QTemporaryDir(heuristicBaseDirectory(fileNames) \
+ "/kleopatra-XXXXXX"); +                    m_workDir = new \
QTemporaryDir(heuristicBaseDirectory(fileNames) + \
QStringLiteral("/kleopatra-XXXXXX"));  }
                 if (!m_workDir->isValid()) {
                     qCDebug(KLEOPATRA_LOG) << m_workDir->path() << "not a valid \
                temporary directory.";
diff --git a/src/crypto/gui/resultitemwidget.cpp \
b/src/crypto/gui/resultitemwidget.cpp index 031c7a42..7cc1f413 100644
--- a/src/crypto/gui/resultitemwidget.cpp
+++ b/src/crypto/gui/resultitemwidget.cpp
@@ -206,7 +206,7 @@ void ResultItemWidget::Private::addKeyImportButton(QBoxLayout \
*lay, bool search)  "Import%1", suffix));
 
         if (search) {
-            btn->setIcon(QIcon::fromTheme("edit-find"));
+            btn->setIcon(QIcon::fromTheme(QStringLiteral("edit-find")));
             connect (btn, &QPushButton::clicked, q, [this, btn, keyid] () {
                 btn->setEnabled(false);
                 m_importCanceled = false;
@@ -222,7 +222,7 @@ void ResultItemWidget::Private::addKeyImportButton(QBoxLayout \
*lay, bool search)  cmd->start();
             });
         } else {
-            btn->setIcon(QIcon::fromTheme("view-certificate-import"));
+            btn->setIcon(QIcon::fromTheme(QStringLiteral("view-certificate-import")));
  connect (btn, &QPushButton::clicked, q, [this, btn] () {
                 btn->setEnabled(false);
                 m_importCanceled = false;
diff --git a/src/crypto/gui/unknownrecipientwidget.cpp \
b/src/crypto/gui/unknownrecipientwidget.cpp index e70dba9f..dab90862 100644
--- a/src/crypto/gui/unknownrecipientwidget.cpp
+++ b/src/crypto/gui/unknownrecipientwidget.cpp
@@ -53,12 +53,12 @@ UnknownRecipientWidget::UnknownRecipientWidget(const char *keyid,
     mKeyID = QString::fromLatin1(keyid);
 
     auto keyIdLabel = new QLabel(mKeyID);
-    keyIdLabel->setFont(QFont("Monospace"));
+    keyIdLabel->setFont(QFont(QStringLiteral("Monospace")));
 
     auto lookUpBtn = new QPushButton(i18n("Search"));
 
 
-    lookUpBtn->setIcon(QIcon::fromTheme("edit-find"));
+    lookUpBtn->setIcon(QIcon::fromTheme(QStringLiteral("edit-find")));
     lookUpBtn->setToolTip(i18n("Search on keyserver"));
     connect (lookUpBtn, &QPushButton::clicked, this, [this, lookUpBtn] () {
         lookUpBtn->setEnabled(false);
diff --git a/src/dialogs/exportdialog.cpp b/src/dialogs/exportdialog.cpp
index 74adcd25..bffa2322 100644
--- a/src/dialogs/exportdialog.cpp
+++ b/src/dialogs/exportdialog.cpp
@@ -108,12 +108,12 @@ static QString injectComments(const GpgME::Key &key, const \
QByteArray &data)  
     // Fixup the HTML coming from the toolTip for our own format.
     overView.remove(QLatin1String("<tr><th>"));
-    overView.replace(QLatin1String("</th><td>"), "\t");
-    overView.replace(QLatin1String("</td></tr>"), "\n");
+    overView.replace(QLatin1String("</th><td>"), QLatin1String("\t"));
+    overView.replace(QLatin1String("</td></tr>"), QLatin1String("\n"));
     overView.remove(QLatin1String("<table border=\"0\">"));
     overView.remove(QLatin1String("\n</table>"));
-    overView.replace(QLatin1String("&lt;"), "<");
-    overView.replace(QLatin1String("&gt;"), ">");
+    overView.replace(QLatin1String("&lt;"), QLatin1String("<"));
+    overView.replace(QLatin1String("&gt;"), QLatin1String(">"));
 
     auto overViewLines = overView.split(QLatin1Char('\n'));
 
@@ -133,7 +133,7 @@ void ExportWidget::exportResult(const GpgME::Error &err, const \
QByteArray &data)  
     if (err) {
         /* Should not happen. But well,.. */
-        d->textEdit->setText(i18nc("%1 is error message", "Failed to export: \
'%1'",err.asString())); +        d->textEdit->setText(i18nc("%1 is error message", \
"Failed to export: '%1'", QString::fromLatin1(err.asString())));  }
 
     d->textEdit->setText(injectComments(d->key, data));
diff --git a/src/dialogs/updatenotification.cpp b/src/dialogs/updatenotification.cpp
index 4e9b1c16..1ff9c03b 100644
--- a/src/dialogs/updatenotification.cpp
+++ b/src/dialogs/updatenotification.cpp
@@ -225,11 +225,11 @@ UpdateNotification::UpdateNotification(QWidget *parent, const \
QString &version)  const auto bb = new QDialogButtonBox();
     const auto b = bb->addButton(i18n("&Get update"), QDialogButtonBox::AcceptRole);
     b->setDefault(true);
-    b->setIcon(QIcon::fromTheme("arrow-down"));
+    b->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down")));
     bb->addButton(QDialogButtonBox::Cancel);
     lay->addWidget(bb, 2, 0, 1, -1);
     connect (bb, &QDialogButtonBox::accepted, this, [this, chk]() {
-            QDesktopServices::openUrl(QUrl("https://www.gpg4win.org/download.html"));
 +            QDesktopServices::openUrl(QUrl(QStringLiteral("https://www.gpg4win.org/download.html")));
                
             KConfigGroup updatecfg(KSharedConfig::openConfig(), \
"UpdateNotification");  updatecfg.writeEntry("NeverShow", !chk->isChecked());
             gpgconf_set_update_check (chk->isChecked());
diff --git a/src/kleopatraapplication.cpp b/src/kleopatraapplication.cpp
index 3b90d064..95a07b4e 100644
--- a/src/kleopatraapplication.cpp
+++ b/src/kleopatraapplication.cpp
@@ -343,7 +343,7 @@ QString KleopatraApplication::newInstance(const \
QCommandLineParser &parser,  }
 
     // Check for --gen-key command
-    if (parser.isSet("gen-key")) {
+    if (parser.isSet(QStringLiteral("gen-key"))) {
         auto cmd = new NewCertificateCommand(nullptr);
         cmd->setParentWId(parentId);
         cmd->setProtocol(protocol);
@@ -352,7 +352,7 @@ QString KleopatraApplication::newInstance(const \
QCommandLineParser &parser,  }
 
     // Check for --config command
-    if (parser.isSet("config")) {
+    if (parser.isSet(QStringLiteral("config"))) {
         openConfigDialogWithForeignParent(parentId);
         return QString();
     }
@@ -426,7 +426,7 @@ QString KleopatraApplication::newInstance(const \
QCommandLineParser &parser,  QDir::setCurrent(QDir::homePath());
 #endif
 
-    return errors.join('\n');
+    return errors.join(QLatin1Char('\n'));
 }
 
 #ifndef QT_NO_SYSTEMTRAYICON
diff --git a/src/smartcard/openpgpcard.cpp b/src/smartcard/openpgpcard.cpp
index 20581dd0..cf963ad0 100644
--- a/src/smartcard/openpgpcard.cpp
+++ b/src/smartcard/openpgpcard.cpp
@@ -126,11 +126,11 @@ void OpenPGPCard::setKeyPairInfo(const std::vector< \
std::pair<std::string, std::  }
             const auto usage = values[0];
             const auto fpr = values[1].toStdString();
-            if (usage == "1") {
+            if (usage == QLatin1String("1")) {
                 mMetaInfo.insert(std::string("SIG") + pair.first, fpr);
-            } else if (usage == "2") {
+            } else if (usage == QLatin1String("2")) {
                 mMetaInfo.insert(std::string("ENC") + pair.first, fpr);
-            } else if (usage == "3") {
+            } else if (usage == QLatin1String("3")) {
                 mMetaInfo.insert(std::string("AUTH") + pair.first, fpr);
             } else {
                 // Maybe more keyslots in the future?
@@ -146,11 +146,11 @@ void OpenPGPCard::setKeyPairInfo(const std::vector< \
std::pair<std::string, std::  }
             const auto usage = values[1];
             const auto grip = values[0].toStdString();
-            if (usage == "OPENPGP.1") {
+            if (usage == QLatin1String("OPENPGP.1")) {
                 mMetaInfo.insert(std::string("SIG") + pair.first, grip);
-            } else if (usage == "OPENPGP.2") {
+            } else if (usage == QLatin1String("OPENPGP.2")) {
                 mMetaInfo.insert(std::string("ENC") + pair.first, grip);
-            } else if (usage == "OPENPGP.3") {
+            } else if (usage == QLatin1String("OPENPGP.3")) {
                 mMetaInfo.insert(std::string("AUTH") + pair.first, grip);
             } else {
                 // Maybe more keyslots in the future?
@@ -225,7 +225,7 @@ std::string OpenPGPCard::cardVersion() const
 
 std::string OpenPGPCard::cardHolder() const
 {
-    auto list = QString::fromStdString(mMetaInfo.value("DISP-NAME")).split("<<");
+    auto list = QString::fromStdString(mMetaInfo.value("DISP-NAME")).split(QStringLiteral("<<"));
  std::reverse(list.begin(), list.end());
     return list.join(QLatin1Char(' ')).toStdString();
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic