diff options
| author | saturneric <[email protected]> | 2026-10-24 11:00:29 +0200 |
|---|---|---|
| committer | saturneric <[email protected]> | 2026-10-24 11:00:29 +0200 |
| commit | acd8cfc36bc2ddb9584f8a27b364f43e5cc24af3 (patch) | |
| tree | ab1936b700b9156d9dce89a0ce67c9f9239ed953 /src/m_pgp_inspect | |
| parent | refactor(email): use Qt string literal operators (diff) | |
| download | modules-acd8cfc36bc2ddb9584f8a27b364f43e5cc24af3.tar.gz modules-acd8cfc36bc2ddb9584f8a27b364f43e5cc24af3.zip | |
refactor: use Qt string literal operators in modules
- replace QStringLiteral with u""_s and QLatin1String with ""_L1 in the
im, key server sync, pgp inspect and version check modules
- spell non-literal Latin-1 views as QLatin1StringView
- import Qt::StringLiterals per file, as modules have no host PCH
Diffstat (limited to 'src/m_pgp_inspect')
| -rw-r--r-- | src/m_pgp_inspect/PGPInspectDialog.cpp | 7 | ||||
| -rw-r--r-- | src/m_pgp_inspect/PGPInspectModel.cpp | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/m_pgp_inspect/PGPInspectDialog.cpp b/src/m_pgp_inspect/PGPInspectDialog.cpp index 27d83fb..dbee47b 100644 --- a/src/m_pgp_inspect/PGPInspectDialog.cpp +++ b/src/m_pgp_inspect/PGPInspectDialog.cpp @@ -41,6 +41,8 @@ #include "GFModuleTr.h" +using namespace Qt::StringLiterals; + namespace { /// Which column holds what. Packet rows use the first only; a field row puts @@ -164,7 +166,7 @@ void PGPInspectDialog::render_document() { } add_fields(item, facts); - if (block.has_armor && block.armor.crc24 == QLatin1String("mismatch")) { + if (block.has_armor && block.armor.crc24 == "mismatch"_L1) { item->setForeground(kLabelColumn, QBrush(QColor(GFUIThemeColorForRole( GFModuleSdkContext(), GF_UI_COLOR_DANGER)))); @@ -185,8 +187,7 @@ void PGPInspectDialog::render_document() { auto summary = GTrC::tr("%1, %2, %n packet(s)", nullptr, packet_count) .arg(document_.format, HumanSize(size_)); if (!document_.errors.isEmpty()) { - summary += - QLatin1String(" - ") + document_.errors.join(QLatin1String("; ")); + summary += " - "_L1 + document_.errors.join("; "_L1); } summary_label_->setText(summary); } diff --git a/src/m_pgp_inspect/PGPInspectModel.cpp b/src/m_pgp_inspect/PGPInspectModel.cpp index 221b106..7c01254 100644 --- a/src/m_pgp_inspect/PGPInspectModel.cpp +++ b/src/m_pgp_inspect/PGPInspectModel.cpp @@ -36,6 +36,8 @@ #include "GFModuleTr.h" +using namespace Qt::StringLiterals; + namespace { auto ParseFields(const QJsonValue& value) -> QList<PGPInspectField> { @@ -166,8 +168,7 @@ auto PGPInspectPacketSummary(const PGPInspectPacket& packet, int index) summary += QString(" @0x%1").arg(packet.offset, 4, 16, QChar('0')); summary += GTrC::tr(" %1 B").arg(packet.header_length + packet.body_length); - if (packet.length_type != QLatin1String("fixed") && - !packet.length_type.isEmpty()) { + if (packet.length_type != "fixed"_L1 && !packet.length_type.isEmpty()) { summary += QString(" [%1]").arg(packet.length_type); } return summary; @@ -175,7 +176,7 @@ auto PGPInspectPacketSummary(const PGPInspectPacket& packet, int index) auto PGPInspectBlockSummary(const PGPInspectBlock& block, int index) -> QString { - if (block.kind == QLatin1String("cleartext")) { + if (block.kind == "cleartext"_L1) { return GTrC::tr("Block %1: cleartext-signed message").arg(index); } if (block.has_armor) { |
