Replace QLatin1String with operator _L1
This commit is contained in:
@@ -43,6 +43,8 @@
|
||||
#include "utilities/strutils.h"
|
||||
#include "covermanager/currentalbumcoverloader.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
const char *OSDBase::kSettingsGroup = "OSD";
|
||||
|
||||
OSDBase::OSDBase(SharedPtr<SystemTrayIcon> tray_icon, Application *app, QObject *parent)
|
||||
@@ -169,7 +171,7 @@ void OSDBase::ShowPlaying(const Song &song, const QUrl &cover_url, const QImage
|
||||
#endif
|
||||
}
|
||||
|
||||
QString message = message_parts.join(QLatin1String(", "));
|
||||
QString message = message_parts.join(", "_L1);
|
||||
if (html_escaped) message = message.toHtmlEscaped();
|
||||
|
||||
if (show_art_) {
|
||||
@@ -201,7 +203,7 @@ void OSDBase::Paused() {
|
||||
else {
|
||||
summary = last_song_.PrettyTitle();
|
||||
if (!last_song_.artist().isEmpty()) {
|
||||
summary.prepend(QLatin1String(" - "));
|
||||
summary.prepend(" - "_L1);
|
||||
summary.prepend(last_song_.artist());
|
||||
}
|
||||
if (behaviour_ == Behaviour::Pretty) {
|
||||
@@ -246,7 +248,7 @@ void OSDBase::Stopped() {
|
||||
else {
|
||||
summary = last_song_.PrettyTitle();
|
||||
if (!last_song_.artist().isEmpty()) {
|
||||
summary.prepend(QLatin1String(" - "));
|
||||
summary.prepend(" - "_L1);
|
||||
summary.prepend(last_song_.artist());
|
||||
}
|
||||
if (behaviour_ == Behaviour::Pretty) {
|
||||
@@ -379,7 +381,7 @@ QString OSDBase::ReplaceMessage(const MessageType type, const QString &message,
|
||||
#endif
|
||||
|
||||
bool html_escaped = false;
|
||||
QString newline = QLatin1String("");
|
||||
QString newline = ""_L1;
|
||||
|
||||
// We need different strings depending on notification type
|
||||
switch (behaviour_) {
|
||||
@@ -392,12 +394,12 @@ QString OSDBase::ReplaceMessage(const MessageType type, const QString &message,
|
||||
switch (type) {
|
||||
case MessageType::Summary:{
|
||||
html_escaped = false;
|
||||
newline = QLatin1String("");
|
||||
newline = ""_L1;
|
||||
break;
|
||||
}
|
||||
case MessageType::Message:{
|
||||
html_escaped = true;
|
||||
newline = QLatin1String("<br />");
|
||||
newline = "<br />"_L1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -412,12 +414,12 @@ QString OSDBase::ReplaceMessage(const MessageType type, const QString &message,
|
||||
case Behaviour::TrayPopup:
|
||||
qLog(Debug) << "New line not supported by this notification type.";
|
||||
html_escaped = false;
|
||||
newline = QLatin1String("");
|
||||
newline = ""_L1;
|
||||
break;
|
||||
case Behaviour::Disabled: // When notifications are disabled, we force the PrettyOSD
|
||||
case Behaviour::Pretty:
|
||||
html_escaped = true;
|
||||
newline = QLatin1String("<br />");
|
||||
newline = "<br />"_L1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
#include "osdpretty.h"
|
||||
#include "ui_osdpretty.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
# include <windows.h>
|
||||
#endif
|
||||
@@ -248,7 +250,7 @@ void OSDPretty::Load() {
|
||||
fading_enabled_ = s.value("fading", false).toBool();
|
||||
#endif
|
||||
|
||||
if (s.contains(QLatin1String("popup_screen"))) {
|
||||
if (s.contains("popup_screen"_L1)) {
|
||||
popup_screen_name_ = s.value("popup_screen").toString();
|
||||
if (screens_.contains(popup_screen_name_)) {
|
||||
popup_screen_ = screens_.value(popup_screen_name_);
|
||||
@@ -264,7 +266,7 @@ void OSDPretty::Load() {
|
||||
if (current_screen()) popup_screen_name_ = current_screen()->name();
|
||||
}
|
||||
|
||||
if (s.contains(QLatin1String("popup_pos"))) {
|
||||
if (s.contains("popup_pos"_L1)) {
|
||||
popup_pos_ = s.value("popup_pos").toPoint();
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user