Replace QStringLiteral with QLatin1String
This commit is contained in:
@@ -133,11 +133,11 @@ Mpris2::Mpris2(Application *app, QObject *parent)
|
||||
|
||||
QStringList data_dirs = QString::fromUtf8(qgetenv("XDG_DATA_DIRS")).split(QLatin1Char(':'));
|
||||
|
||||
if (!data_dirs.contains(QStringLiteral("/usr/local/share"))) {
|
||||
if (!data_dirs.contains(QLatin1String("/usr/local/share"))) {
|
||||
data_dirs.append(QStringLiteral("/usr/local/share"));
|
||||
}
|
||||
|
||||
if (!data_dirs.contains(QStringLiteral("/usr/share"))) {
|
||||
if (!data_dirs.contains(QLatin1String("/usr/share"))) {
|
||||
data_dirs.append(QStringLiteral("/usr/share"));
|
||||
}
|
||||
|
||||
@@ -207,18 +207,18 @@ void Mpris2::EmitNotification(const QString &name, const QVariant &value, const
|
||||
void Mpris2::EmitNotification(const QString &name) {
|
||||
|
||||
QVariant value;
|
||||
if (name == QStringLiteral("PlaybackStatus")) value = PlaybackStatus();
|
||||
else if (name == QStringLiteral("LoopStatus")) value = LoopStatus();
|
||||
else if (name == QStringLiteral("Shuffle")) value = Shuffle();
|
||||
else if (name == QStringLiteral("Metadata")) value = Metadata();
|
||||
else if (name == QStringLiteral("Rating")) value = Rating();
|
||||
else if (name == QStringLiteral("Volume")) value = Volume();
|
||||
else if (name == QStringLiteral("Position")) value = Position();
|
||||
else if (name == QStringLiteral("CanPlay")) value = CanPlay();
|
||||
else if (name == QStringLiteral("CanPause")) value = CanPause();
|
||||
else if (name == QStringLiteral("CanSeek")) value = CanSeek();
|
||||
else if (name == QStringLiteral("CanGoNext")) value = CanGoNext();
|
||||
else if (name == QStringLiteral("CanGoPrevious")) value = CanGoPrevious();
|
||||
if (name == QLatin1String("PlaybackStatus")) value = PlaybackStatus();
|
||||
else if (name == QLatin1String("LoopStatus")) value = LoopStatus();
|
||||
else if (name == QLatin1String("Shuffle")) value = Shuffle();
|
||||
else if (name == QLatin1String("Metadata")) value = Metadata();
|
||||
else if (name == QLatin1String("Rating")) value = Rating();
|
||||
else if (name == QLatin1String("Volume")) value = Volume();
|
||||
else if (name == QLatin1String("Position")) value = Position();
|
||||
else if (name == QLatin1String("CanPlay")) value = CanPlay();
|
||||
else if (name == QLatin1String("CanPause")) value = CanPause();
|
||||
else if (name == QLatin1String("CanSeek")) value = CanSeek();
|
||||
else if (name == QLatin1String("CanGoNext")) value = CanGoNext();
|
||||
else if (name == QLatin1String("CanGoPrevious")) value = CanGoPrevious();
|
||||
|
||||
if (value.isValid()) EmitNotification(name, value);
|
||||
|
||||
@@ -240,7 +240,7 @@ QString Mpris2::DesktopEntryAbsolutePath() const {
|
||||
|
||||
}
|
||||
|
||||
QString Mpris2::DesktopEntry() const { return QGuiApplication::desktopFileName() + QStringLiteral(".desktop"); }
|
||||
QString Mpris2::DesktopEntry() const { return QGuiApplication::desktopFileName() + QLatin1String(".desktop"); }
|
||||
|
||||
QStringList Mpris2::SupportedUriSchemes() const {
|
||||
|
||||
@@ -460,7 +460,7 @@ bool Mpris2::CanPlay() const {
|
||||
|
||||
// This one's a bit different than MPRIS 1 - we want this to be true even when the song is already paused or stopped.
|
||||
bool Mpris2::CanPause() const {
|
||||
return (app_->player()->GetCurrentItem() && app_->player()->GetState() == EngineBase::State::Playing && !(app_->player()->GetCurrentItem()->options() & PlaylistItem::Option::PauseDisabled)) || PlaybackStatus() == QStringLiteral("Paused") || PlaybackStatus() == QStringLiteral("Stopped");
|
||||
return (app_->player()->GetCurrentItem() && app_->player()->GetState() == EngineBase::State::Playing && !(app_->player()->GetCurrentItem()->options() & PlaylistItem::Option::PauseDisabled)) || PlaybackStatus() == QLatin1String("Paused") || PlaybackStatus() == QLatin1String("Stopped");
|
||||
}
|
||||
|
||||
bool Mpris2::CanSeek() const { return CanSeek(app_->player()->GetState()); }
|
||||
|
||||
@@ -144,10 +144,10 @@ const QStringList Song::kColumns = QStringList() << QStringLiteral("title")
|
||||
|
||||
const QStringList Song::kRowIdColumns = QStringList() << QStringLiteral("ROWID") << kColumns;
|
||||
|
||||
const QString Song::kColumnSpec = kColumns.join(QStringLiteral(", "));
|
||||
const QString Song::kRowIdColumnSpec = kRowIdColumns.join(QStringLiteral(", "));
|
||||
const QString Song::kBindSpec = Utilities::Prepend(QStringLiteral(":"), kColumns).join(QStringLiteral(", "));
|
||||
const QString Song::kUpdateSpec = Utilities::Updateify(kColumns).join(QStringLiteral(", "));
|
||||
const QString Song::kColumnSpec = kColumns.join(QLatin1String(", "));
|
||||
const QString Song::kRowIdColumnSpec = kRowIdColumns.join(QLatin1String(", "));
|
||||
const QString Song::kBindSpec = Utilities::Prepend(QStringLiteral(":"), kColumns).join(QLatin1String(", "));
|
||||
const QString Song::kUpdateSpec = Utilities::Updateify(kColumns).join(QLatin1String(", "));
|
||||
|
||||
const QStringList Song::kTextSearchColumns = QStringList() << QStringLiteral("title")
|
||||
<< QStringLiteral("album")
|
||||
@@ -711,7 +711,7 @@ int Song::ColumnIndex(const QString &field) {
|
||||
}
|
||||
|
||||
QString Song::JoinSpec(const QString &table) {
|
||||
return Utilities::Prepend(table + QLatin1Char('.'), kRowIdColumns).join(QStringLiteral(", "));
|
||||
return Utilities::Prepend(table + QLatin1Char('.'), kRowIdColumns).join(QLatin1String(", "));
|
||||
}
|
||||
|
||||
QString Song::PrettyTitle() const {
|
||||
|
||||
@@ -93,29 +93,29 @@ void StyleSheetLoader::UpdateStyleSheet(QWidget *widget, SharedPtr<StyleSheetDat
|
||||
stylesheet.replace(QLatin1String("%palette-alternate-base"), QStringLiteral("rgba(%1,%2,%3,%4)").arg(alt.red()).arg(alt.green()).arg(alt.blue()).arg(alt.alpha()));
|
||||
}
|
||||
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Window"), p, QPalette::Window);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Background"), p, QPalette::Window);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("WindowText"), p, QPalette::WindowText);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Base"), p, QPalette::Base);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("AlternateBase"), p, QPalette::AlternateBase);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("ToolTipBase"), p, QPalette::ToolTipBase);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("ToolTipText"), p, QPalette::ToolTipText);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Text"), p, QPalette::Text);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Button"), p, QPalette::Button);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("ButtonText"), p, QPalette::ButtonText);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("BrightText"), p, QPalette::BrightText);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Light"), p, QPalette::Light);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Midlight"), p, QPalette::Midlight);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Dark"), p, QPalette::Dark);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Mid"), p, QPalette::Mid);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Shadow"), p, QPalette::Shadow);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Highlight"), p, QPalette::Highlight);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("HighlightedText"), p, QPalette::HighlightedText);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("Link"), p, QPalette::Link);
|
||||
ReplaceColor(&stylesheet, QStringLiteral("LinkVisited"), p, QPalette::LinkVisited);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Window"), p, QPalette::Window);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Background"), p, QPalette::Window);
|
||||
ReplaceColor(&stylesheet, QLatin1String("WindowText"), p, QPalette::WindowText);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Base"), p, QPalette::Base);
|
||||
ReplaceColor(&stylesheet, QLatin1String("AlternateBase"), p, QPalette::AlternateBase);
|
||||
ReplaceColor(&stylesheet, QLatin1String("ToolTipBase"), p, QPalette::ToolTipBase);
|
||||
ReplaceColor(&stylesheet, QLatin1String("ToolTipText"), p, QPalette::ToolTipText);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Text"), p, QPalette::Text);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Button"), p, QPalette::Button);
|
||||
ReplaceColor(&stylesheet, QLatin1String("ButtonText"), p, QPalette::ButtonText);
|
||||
ReplaceColor(&stylesheet, QLatin1String("BrightText"), p, QPalette::BrightText);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Light"), p, QPalette::Light);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Midlight"), p, QPalette::Midlight);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Dark"), p, QPalette::Dark);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Mid"), p, QPalette::Mid);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Shadow"), p, QPalette::Shadow);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Highlight"), p, QPalette::Highlight);
|
||||
ReplaceColor(&stylesheet, QLatin1String("HighlightedText"), p, QPalette::HighlightedText);
|
||||
ReplaceColor(&stylesheet, QLatin1String("Link"), p, QPalette::Link);
|
||||
ReplaceColor(&stylesheet, QLatin1String("LinkVisited"), p, QPalette::LinkVisited);
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
stylesheet.replace(QStringLiteral("macos"), QStringLiteral("*"));
|
||||
stylesheet.replace(QLatin1String("macos"), QLatin1String("*"));
|
||||
#endif
|
||||
|
||||
if (stylesheet != styledata->stylesheet_current_) {
|
||||
|
||||
Reference in New Issue
Block a user