Commit a4ccf77a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent d372cb57
......@@ -204,7 +204,7 @@ void MarkdownInterface::addEmbeddedImages(MessageComposer::TextPart *textPart, Q
if (!listImage.isEmpty()) {
listImage.removeDuplicates();
QStringList imageNameAdded;
for (const QString &urlImage : listImage) {
for (const QString &urlImage : qAsConst(listImage)) {
const QUrl url = QUrl::fromUserInput(urlImage);
if (!url.isLocalFile()) {
qCWarning(KMAIL_EDITOR_MARKDOWN_PLUGIN_LOG) << "Url is not a local file " << url;
......
......@@ -89,7 +89,7 @@ bool QuickTextPluginEditorInterface::processProcessKeyEvent(QKeyEvent *e)
return false;
}
//qDebug() << "selected " << selectedWord;
for (const MailCommon::SnippetsInfo &info : mSnippetsInfo) {
for (const MailCommon::SnippetsInfo &info : qAsConst(mSnippetsInfo)) {
//qDebug() << " info.keyword" << info.keyword;
QString infoKeyword = info.keyword;
if (!infoKeyword.startsWith(QLatin1Char('\\'))) {
......
......@@ -122,15 +122,16 @@ void GrammarResultTextEdit::contextMenuEvent(QContextMenuEvent *event)
if (!sugg.isEmpty()) {
popup->addSeparator();
QMenu *popupReplacement = popup->addMenu(i18n("Replacement"));
for (const QString &str : act.suggestions()) {
for (const QString &str : sugg) {
QAction *actReplacement = popupReplacement->addAction(str);
connect(actReplacement, &QAction::triggered, this, [this, act, str]() {
slotReplaceWord(act, str);
});
}
if (!act.infoUrls().isEmpty()) {
const QStringList lst = act.infoUrls();
if (!lst.isEmpty()) {
QMenu *popupUrlInfo = popup->addMenu(i18n("Online Grammar Information"));
for (const QString &str : act.infoUrls()) {
for (const QString &str : lst) {
QAction *actUrlInfo = popupUrlInfo->addAction(str);
connect(actUrlInfo, &QAction::triggered, this, [this, str]() {
slotOpenGrammarUrlInfo(str);
......
......@@ -1106,7 +1106,7 @@ public:
void showCalendar(const QDate &date) const
{
// If korganizer or kontact is running, bring it to the front. Otherwise start korganizer.
if (KontactInterface::PimUniqueApplication::activateApplication(QLatin1String("korganizer"))) {
if (KontactInterface::PimUniqueApplication::activateApplication(QStringLiteral("korganizer"))) {
OrgKdeKorganizerCalendarInterface iface(QStringLiteral("org.kde.korganizer"), QStringLiteral("/Calendar"),
QDBusConnection::sessionBus(), nullptr);
if (!iface.isValid()) {
......
......@@ -149,7 +149,7 @@ MimeTreeParser::MessagePart::Ptr ItineraryProcessor::process(MimeTreeParser::Int
const auto docData = part.content()->decodedContent();
const auto docId = DocumentUtil::idForContent(docData);
DigitalDocument docInfo;
docInfo.setEncodingFormat(QLatin1String("application/pdf"));
docInfo.setEncodingFormat(QStringLiteral("application/pdf"));
docInfo.setName(MimeTreeParser::NodeHelper::fileName(part.content()));
memento->addDocument(docId, docInfo, docData);
......
......@@ -185,7 +185,7 @@ ItineraryMemento *ItineraryUrlHandler::memento(MimeTreeParser::Interface::BodyPa
void ItineraryUrlHandler::showCalendar(const QDate &date) const
{
// ensure KOrganizer or Kontact are running
if (KontactInterface::PimUniqueApplication::activateApplication(QLatin1String("korganizer"))) {
if (KontactInterface::PimUniqueApplication::activateApplication(QStringLiteral("korganizer"))) {
// select the date of the reservation
QDBusInterface korgIface(QStringLiteral("org.kde.korganizer"), QStringLiteral("/Calendar"),
QStringLiteral("org.kde.Korganizer.Calendar"), QDBusConnection::sessionBus());
......
......@@ -117,7 +117,7 @@ QString BriefHeaderStyle::format(KMime::Message *message) const
}
// remove all empty (modulo whitespace) entries and joins them via ", \n"
headerStr += QLatin1String(" (") + headerParts.filter(QRegularExpression(QLatin1String("\\S"))).join(QLatin1String(",\n")) + QLatin1Char(')');
headerStr += QLatin1String(" (") + headerParts.filter(QRegularExpression(QStringLiteral("\\S"))).join(QLatin1String(",\n")) + QLatin1Char(')');
headerStr += QLatin1String("</div>\n");
......
......@@ -606,7 +606,7 @@ bool AdBlockRule::filterIsOnlyEndsMatch(const QString &filter) const
return false;
}
static bool wordCharacter(const QChar &c)
static bool wordCharacter(QChar c)
{
return c.isLetterOrNumber() || c.isMark() || c == QLatin1Char('_');
}
......
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