Commit 7d6d053a authored by Laurent Montel's avatar Laurent Montel 😁

Use QLatin1String

parent a61ed4c2
......@@ -239,8 +239,8 @@ void ExportCertificateCommand::Private::startExportJob(GpgME::Protocol protocol,
Q_ASSERT(backend);
const QString fileName = fileNames[protocol];
const bool binary = protocol == GpgME::OpenPGP
? fileName.endsWith(QStringLiteral(".gpg"), Qt::CaseInsensitive) || fileName.endsWith(QStringLiteral(".pgp"), Qt::CaseInsensitive)
: fileName.endsWith(QStringLiteral(".der"), Qt::CaseInsensitive);
? fileName.endsWith(QLatin1String(".gpg"), Qt::CaseInsensitive) || fileName.endsWith(QLatin1String(".pgp"), Qt::CaseInsensitive)
: fileName.endsWith(QLatin1String(".der"), Qt::CaseInsensitive);
std::unique_ptr<ExportJob> job(backend->publicKeyExportJob(!binary));
Q_ASSERT(job.get());
......
......@@ -423,7 +423,7 @@ void LookupCertificatesCommand::Private::showHexPrefixInfo() const
{
const QRegExp rx(QLatin1String("(?:0x|0X)?[0-9a-fA-F]{6,}"));
if (rx.exactMatch(query)) {
information(query.startsWith(QStringLiteral("0x"), Qt::CaseInsensitive)
information(query.startsWith(QLatin1String("0x"), Qt::CaseInsensitive)
? i18n("<p>You seem to be searching for a fingerPrint or a key-id.</p>"
"<p>Different keyservers expect different ways to search for these. "
"Some require a \"0x\" prefix, while others require there be no such prefix.</p>"
......
......@@ -280,7 +280,7 @@ std::shared_ptr<ArchiveDefinition> DecryptVerifyFilesController::pick_archive_de
return std::shared_ptr<ArchiveDefinition>();
}
if (extension.endsWith(QStringLiteral(".out"))) { // added by outputFileName() -> remove
if (extension.endsWith(QLatin1String(".out"))) { // added by outputFileName() -> remove
extension.chop(4);
}
......
......@@ -303,7 +303,7 @@ void ResultItemWidget::Private::slotLinkActivated(const QString &link)
{
Q_ASSERT(m_result);
qCDebug(KLEOPATRA_LOG) << "Link activated: " << link;
if (link.startsWith(QStringLiteral("key:"))) {
if (link.startsWith(QLatin1String("key:"))) {
auto split = link.split(QLatin1Char(':'));
auto fpr = split.value(1);
if (split.size() == 2 && isFingerprint(fpr)) {
......
......@@ -246,11 +246,11 @@ static void parseAlgoString(const QString &algoString, int *size, Subkey::Pubkey
return;
}
*algo = Subkey::AlgoUnknown;
if (lowered.startsWith(QStringLiteral("rsa"))) {
if (lowered.startsWith(QLatin1String("rsa"))) {
*algo = Subkey::AlgoRSA;
} else if (lowered.startsWith(QStringLiteral("dsa"))) {
} else if (lowered.startsWith(QLatin1String("dsa"))) {
*algo = Subkey::AlgoDSA;
} else if (lowered.startsWith(QStringLiteral("elg"))) {
} else if (lowered.startsWith(QLatin1String("elg"))) {
*algo = Subkey::AlgoELG;
}
......@@ -265,7 +265,7 @@ static void parseAlgoString(const QString &algoString, int *size, Subkey::Pubkey
}
// Now the ECC Algorithms
if (lowered.startsWith(QStringLiteral("ed25519"))) {
if (lowered.startsWith(QLatin1String("ed25519"))) {
// Special handling for this as technically
// this is a cv25519 curve used for EDDSA
curve = split[0];
......@@ -273,10 +273,10 @@ static void parseAlgoString(const QString &algoString, int *size, Subkey::Pubkey
return;
}
if (lowered.startsWith(QStringLiteral("cv25519")) ||
lowered.startsWith(QStringLiteral("nist")) ||
lowered.startsWith(QStringLiteral("brainpool")) ||
lowered.startsWith(QStringLiteral("secp"))) {
if (lowered.startsWith(QLatin1String("cv25519")) ||
lowered.startsWith(QLatin1String("nist")) ||
lowered.startsWith(QLatin1String("brainpool")) ||
lowered.startsWith(QLatin1String("secp"))) {
curve = split[0];
*algo = isEncrypt ? Subkey::AlgoECDH : Subkey::AlgoECDSA;
return;
......
......@@ -141,7 +141,7 @@ QString Kleo::gpg4winVersion()
return QStringLiteral("Unknown (no VERSION file found)");
}
const QString g4wTag = QString::fromUtf8(versionFile.readLine());
if (!g4wTag.startsWith(QStringLiteral("gpg4win"))) {
if (!g4wTag.startsWith(QLatin1String("gpg4win"))) {
// Hu? Something unknown
return QStringLiteral("Unknown (invalid VERSION file found)");
}
......
......@@ -825,7 +825,7 @@ void TabWidget::createActions(KActionCollection *coll)
for (int i = 0; i < d->NumPageActions; ++i) {
action_data ad = actionData[i];
Q_ASSERT(QString::fromLatin1(ad.name).startsWith(QStringLiteral("window_")));
Q_ASSERT(QString::fromLatin1(ad.name).startsWith(QLatin1String("window_")));
ad.name = ad.name + strlen("window_");
ad.tooltip.clear();
ad.receiver = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment