diff --git a/src/customdocument.cpp b/src/customdocument.cpp index 587af4c4..2e1214ae 100644 --- a/src/customdocument.cpp +++ b/src/customdocument.cpp @@ -198,7 +198,7 @@ bool CustomDocument::openLinkAtCursorPosition() } if (isLocalFilePath && convertLocalFilepathsToURLs) { - openUrl(QString("file://") + urlString); + openUrl(QStringLiteral("file://") + urlString); } else { openUrl(urlString); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 87373d9f..90399ec7 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1076,11 +1076,11 @@ void MainWindow::setupEditorSettings() emit displayFontSet(QVariant(dataToSendToView)); #if defined(Q_OS_WINDOWS) - emit platformSet(QVariant(QString("Windows"))); + emit platformSet(QVariant(QStringLiteral("Windows"))); #elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) - emit platformSet(QVariant(QString("Unix"))); + emit platformSet(QVariant(QStringLiteral("Unix"))); #elif defined(Q_OS_MACOS) - emit platformSet(QVariant(QString("Apple"))); + emit platformSet(QVariant(QStringLiteral("Apple"))); #endif #if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) @@ -1199,7 +1199,7 @@ void MainWindow::alignTextEditText() QFontMetricsF fm(m_currentSelectedFont); QString limitingStringSample = - QString("The quick brown fox jumps over the lazy dog the quick brown fox jumps over " + QStringLiteral("The quick brown fox jumps over the lazy dog the quick brown fox jumps over " "the lazy dog the quick brown fox jumps over the lazy dog"); limitingStringSample.truncate(m_textEdit->lineWrapColumnOrWidth()); qreal textSamplePixelsWidth = fm.horizontalAdvance(limitingStringSample); @@ -1297,11 +1297,11 @@ void MainWindow::setupKanbanView() ui->verticalLayout_textEdit->insertWidget(ui->verticalLayout_textEdit->indexOf(m_textEdit), m_kanbanWidget); # if defined(Q_OS_WINDOWS) - emit platformSet(QVariant(QString("Windows"))); + emit platformSet(QVariant(QStringLiteral("Windows"))); # elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) - emit platformSet(QVariant(QString("Unix"))); + emit platformSet(QVariant(QStringLiteral("Unix"))); # elif defined(Q_OS_MACOS) - emit platformSet(QVariant(QString("Apple"))); + emit platformSet(QVariant(QStringLiteral("Apple"))); # endif QJsonObject dataToSendToView{ { "displayFont", @@ -4195,9 +4195,9 @@ void MainWindow::setHeading(int level) new_text.clear(); } selected_text = selected_text.trimmed().remove(QRegularExpression("^#*\\s?")); - new_text += QString("#").repeated(level) + ((level == 0) ? "" : " ") + selected_text; + new_text += QStringLiteral("#").repeated(level) + ((level == 0) ? "" : " ") + selected_text; } else { - new_text = QString("#").repeated(level) + " "; + new_text = QStringLiteral("#").repeated(level) + " "; } cursor.insertText(new_text); } diff --git a/src/notelistview.cpp b/src/notelistview.cpp index db8df9d6..ed9e4c0f 100644 --- a/src/notelistview.cpp +++ b/src/notelistview.cpp @@ -741,7 +741,7 @@ void NoteListView::onCustomContextMenu(QPoint point) } for (auto id : std::as_const(tagInNote)) { auto tag = m_tagPool->getTag(id); - auto tagAction = new QAction(QString("✓ Remove tag ") + tag.name(), this); + auto tagAction = new QAction(QStringLiteral("✓ Remove tag ") + tag.name(), this); connect(tagAction, &QAction::triggered, this, [this, id, notes] { removeNotesFromTag(notes, id); }); tagAction->setIcon(createTagIcon(tag.color())); @@ -754,7 +754,7 @@ void NoteListView::onCustomContextMenu(QPoint point) continue; } auto tag = m_tagPool->getTag(id); - auto tagAction = new QAction(QString(" ") + tag.name(), this); + auto tagAction = new QAction(QStringLiteral(" ") + tag.name(), this); connect(tagAction, &QAction::triggered, this, [this, id, notes] { addNotesToTag(notes, id); }); tagAction->setIcon(createTagIcon(tag.color())); diff --git a/src/updaterwindow.cpp b/src/updaterwindow.cpp index 9a0ea045..d718c2fc 100644 --- a/src/updaterwindow.cpp +++ b/src/updaterwindow.cpp @@ -294,7 +294,7 @@ void UpdaterWindow::startDownload(const QUrl &url) /* Set file name */ m_fileName = m_updater->getDownloadUrl(UPDATES_URL).split("/").last(); if (m_fileName.isEmpty()) { - m_fileName = QString("%1_Update_%2.bin") + m_fileName = QStringLiteral("%1_Update_%2.bin") .arg(QCoreApplication::applicationName(), m_updater->getLatestVersion(UPDATES_URL)); }