Replace QStringLiteral with QLatin1String

This commit is contained in:
Jonas Kvinge
2024-06-12 02:13:27 +02:00
parent 597a8cd6c8
commit b89c200076
73 changed files with 1215 additions and 1215 deletions

View File

@@ -117,7 +117,7 @@ PlaylistBackend::PlaylistList PlaylistBackend::GetPlaylists(const GetPlaylistsFl
}
QString condition;
if (!condition_list.isEmpty()) {
condition = QStringLiteral(" WHERE ") + condition_list.join(QStringLiteral(" OR "));
condition = QLatin1String(" WHERE ") + condition_list.join(QLatin1String(" OR "));
}
SqlQuery q(db);

View File

@@ -124,7 +124,7 @@ PlaylistContainer::PlaylistContainer(QWidget *parent)
QObject::connect(ui_->playlist, &PlaylistView::FocusOnFilterSignal, this, &PlaylistContainer::FocusOnFilter);
ui_->search_field->installEventFilter(this);
QString available_fields = PlaylistFilter().column_names().keys().join(QStringLiteral(", "));
QString available_fields = PlaylistFilter().column_names().keys().join(QLatin1String(", "));
ui_->search_field->setToolTip(
QStringLiteral("<html><head/><body><p>") +
tr("Prefix a search term with a field name to limit the search to that field, e.g.:") +
@@ -136,7 +136,7 @@ PlaylistContainer::PlaylistContainer(QWidget *parent)
QStringLiteral("</p><p>") +
tr("Search terms for numerical fields can be prefixed with %1 or %2 to refine the search, e.g.: ")
.arg(QStringLiteral(" =, !=, &lt;, &gt;, &lt;="), QStringLiteral("&gt;=")) +
.arg(QLatin1String(" =, !=, &lt;, &gt;, &lt;="), QStringLiteral("&gt;=")) +
QStringLiteral("<span style=\"font-weight:600;\">") +
tr("rating") +
QStringLiteral("</span>") +
@@ -145,7 +145,7 @@ PlaylistContainer::PlaylistContainer(QWidget *parent)
QStringLiteral("</p><p>") +
tr("Multiple search terms can also be combined with \"%1\" (default) and \"%2\", as well as grouped with parentheses. ")
.arg(QStringLiteral("AND"), QStringLiteral("OR")) +
.arg(QLatin1String("AND"), QLatin1String("OR")) +
QStringLiteral("</p><p><span style=\"font-weight:600;\">") +
tr("Available fields") +

View File

@@ -68,7 +68,7 @@ QString PlaylistListModel::ItemPath(const QStandardItem *item) {
current = current->parent();
}
return components.join(QStringLiteral("/"));
return components.join(QLatin1Char('/'));
}

View File

@@ -333,7 +333,7 @@ void PlaylistTabBar::RemoveTab(const int id) {
void PlaylistTabBar::set_text_by_id(const int id, const QString &text) {
QString new_text = text;
new_text = new_text.replace(QLatin1String("&"), QLatin1String("&&"));
new_text = new_text.replace(QLatin1Char('&'), QLatin1String("&&"));
setTabText(index_of(id), new_text);
setTabToolTip(index_of(id), text);

View File

@@ -1399,7 +1399,7 @@ void PlaylistView::CopyCurrentSongToClipboard() const {
QMimeData *mime_data = new QMimeData;
mime_data->setUrls(QList<QUrl>() << url);
mime_data->setText(columns.join(QStringLiteral(" - ")));
mime_data->setText(columns.join(QLatin1String(" - ")));
QApplication::clipboard()->setMimeData(mime_data);