Replace QLatin1String with operator _L1
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
#include "streamingsearchmodel.h"
|
||||
#include "streamingsearchview.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
StreamingSearchModel::StreamingSearchModel(StreamingServicePtr service, QObject *parent)
|
||||
: QStandardItemModel(parent),
|
||||
service_(service),
|
||||
@@ -91,7 +93,7 @@ QStandardItem *StreamingSearchModel::BuildContainers(const Song &s, QStandardIte
|
||||
case CollectionModel::GroupBy::AlbumArtist:
|
||||
if (s.is_compilation()) {
|
||||
display_text = tr("Various artists");
|
||||
sort_text = QLatin1String("aaaaaa");
|
||||
sort_text = "aaaaaa"_L1;
|
||||
}
|
||||
else {
|
||||
display_text = CollectionModel::TextOrUnknown(s.effective_albumartist());
|
||||
@@ -103,7 +105,7 @@ QStandardItem *StreamingSearchModel::BuildContainers(const Song &s, QStandardIte
|
||||
case CollectionModel::GroupBy::Artist:
|
||||
if (s.is_compilation()) {
|
||||
display_text = tr("Various artists");
|
||||
sort_text = QLatin1String("aaaaaa");
|
||||
sort_text = "aaaaaa"_L1;
|
||||
}
|
||||
else {
|
||||
display_text = CollectionModel::TextOrUnknown(s.artist());
|
||||
@@ -251,7 +253,7 @@ QStandardItem *StreamingSearchModel::BuildContainers(const Song &s, QStandardIte
|
||||
}
|
||||
|
||||
if (display_text.isEmpty() || sort_text.isEmpty()) {
|
||||
display_text = QLatin1String("Unknown");
|
||||
display_text = "Unknown"_L1;
|
||||
}
|
||||
|
||||
// Find a container for this level
|
||||
|
||||
@@ -440,11 +440,11 @@ QStringList StreamingSearchView::TokenizeQuery(const QString &query) {
|
||||
QStringList tokens = query.split(regex_whitespaces);
|
||||
|
||||
for (QStringList::iterator it = tokens.begin(); it != tokens.end(); ++it) {
|
||||
(*it).remove(QLatin1Char('('));
|
||||
(*it).remove(QLatin1Char(')'));
|
||||
(*it).remove(QLatin1Char('"'));
|
||||
(*it).remove(u'(');
|
||||
(*it).remove(u')');
|
||||
(*it).remove(u'"');
|
||||
|
||||
const qint64 colon = (*it).indexOf(QLatin1Char(':'));
|
||||
const qint64 colon = (*it).indexOf(u':');
|
||||
if (colon != -1) {
|
||||
(*it).remove(0, colon + 1);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#include "streamingcollectionviewcontainer.h"
|
||||
#include "ui_streamingtabsview.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
StreamingTabsView::StreamingTabsView(Application *app, StreamingServicePtr service, const QString &settings_group, const SettingsDialog::Page settings_page, QWidget *parent)
|
||||
: QWidget(parent),
|
||||
app_(app),
|
||||
@@ -165,16 +167,16 @@ StreamingTabsView::StreamingTabsView(Application *app, StreamingServicePtr servi
|
||||
QString tab = s.value("tab", QStringLiteral("artists")).toString().toLower();
|
||||
s.endGroup();
|
||||
|
||||
if (tab == QLatin1String("artists")) {
|
||||
if (tab == "artists"_L1) {
|
||||
ui_->tabs->setCurrentWidget(ui_->artists);
|
||||
}
|
||||
else if (tab == QLatin1String("albums")) {
|
||||
else if (tab == "albums"_L1) {
|
||||
ui_->tabs->setCurrentWidget(ui_->albums);
|
||||
}
|
||||
else if (tab == QLatin1String("songs")) {
|
||||
else if (tab == "songs"_L1) {
|
||||
ui_->tabs->setCurrentWidget(ui_->songs);
|
||||
}
|
||||
else if (tab == QLatin1String("search")) {
|
||||
else if (tab == "search"_L1) {
|
||||
ui_->tabs->setCurrentWidget(ui_->search);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user