Replace QLatin1String with operator _L1
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
#include "globalshortcutgrabber.h"
|
||||
#include "ui_globalshortcutgrabber.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
GlobalShortcutGrabber::GlobalShortcutGrabber(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
ui_(new Ui::GlobalShortcutGrabber),
|
||||
@@ -110,7 +112,7 @@ bool GlobalShortcutGrabber::event(QEvent *e) {
|
||||
}
|
||||
|
||||
void GlobalShortcutGrabber::UpdateText() {
|
||||
ui_->label_key->setText(QLatin1String("<b>") + ret_.toString(QKeySequence::NativeText) + QLatin1String("</b>"));
|
||||
ui_->label_key->setText("<b>"_L1 + ret_.toString(QKeySequence::NativeText) + "</b>"_L1);
|
||||
}
|
||||
|
||||
void GlobalShortcutGrabber::Accepted() {
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
#include "gnomesettingsdaemon.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace {
|
||||
constexpr char kService1[] = "org.gnome.SettingsDaemon.MediaKeys";
|
||||
constexpr char kService2[] = "org.gnome.SettingsDaemon";
|
||||
@@ -118,9 +120,9 @@ void GlobalShortcutsBackendGnome::DoUnregister() {
|
||||
void GlobalShortcutsBackendGnome::GnomeMediaKeyPressed(const QString&, const QString &key) {
|
||||
|
||||
auto shortcuts = manager_->shortcuts();
|
||||
if (key == QLatin1String("Play")) shortcuts[QStringLiteral("play_pause")].action->trigger();
|
||||
if (key == QLatin1String("Stop")) shortcuts[QStringLiteral("stop")].action->trigger();
|
||||
if (key == QLatin1String("Next")) shortcuts[QStringLiteral("next_track")].action->trigger();
|
||||
if (key == QLatin1String("Previous")) shortcuts[QStringLiteral("prev_track")].action->trigger();
|
||||
if (key == "Play"_L1) shortcuts[QStringLiteral("play_pause")].action->trigger();
|
||||
if (key == "Stop"_L1) shortcuts[QStringLiteral("stop")].action->trigger();
|
||||
if (key == "Next"_L1) shortcuts[QStringLiteral("next_track")].action->trigger();
|
||||
if (key == "Previous"_L1) shortcuts[QStringLiteral("prev_track")].action->trigger();
|
||||
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ QStringList GlobalShortcutsBackendKDE::GetActionId(const QString &id, const QAct
|
||||
ret << QCoreApplication::applicationName();
|
||||
ret << id;
|
||||
ret << QCoreApplication::applicationName();
|
||||
ret << action->text().remove(QLatin1Char('&'));
|
||||
ret << action->text().remove(u'&');
|
||||
if (ret.back().isEmpty()) ret.back() = id;
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
#include "matesettingsdaemon.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
namespace {
|
||||
constexpr char kService1[] = "org.mate.SettingsDaemon.MediaKeys";
|
||||
constexpr char kService2[] = "org.mate.SettingsDaemon";
|
||||
@@ -118,9 +120,9 @@ void GlobalShortcutsBackendMate::DoUnregister() {
|
||||
void GlobalShortcutsBackendMate::MateMediaKeyPressed(const QString&, const QString &key) {
|
||||
|
||||
auto shortcuts = manager_->shortcuts();
|
||||
if (key == QLatin1String("Play")) shortcuts[QStringLiteral("play_pause")].action->trigger();
|
||||
if (key == QLatin1String("Stop")) shortcuts[QStringLiteral("stop")].action->trigger();
|
||||
if (key == QLatin1String("Next")) shortcuts[QStringLiteral("next_track")].action->trigger();
|
||||
if (key == QLatin1String("Previous")) shortcuts[QStringLiteral("prev_track")].action->trigger();
|
||||
if (key == "Play"_L1) shortcuts[QStringLiteral("play_pause")].action->trigger();
|
||||
if (key == "Stop"_L1) shortcuts[QStringLiteral("stop")].action->trigger();
|
||||
if (key == "Next"_L1) shortcuts[QStringLiteral("next_track")].action->trigger();
|
||||
if (key == "Previous"_L1) shortcuts[QStringLiteral("prev_track")].action->trigger();
|
||||
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include "globalshortcutsbackend.h"
|
||||
#include "globalshortcut.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
GlobalShortcutsBackendX11::GlobalShortcutsBackendX11(GlobalShortcutsManager *manager, QObject *parent)
|
||||
: GlobalShortcutsBackend(manager, GlobalShortcutsBackend::Type::X11, parent),
|
||||
gshortcut_init_(nullptr) {}
|
||||
@@ -45,7 +47,7 @@ bool GlobalShortcutsBackendX11::IsAvailable() const {
|
||||
|
||||
bool GlobalShortcutsBackendX11::IsX11Available() {
|
||||
|
||||
return QApplication::platformName() == QLatin1String("xcb");
|
||||
return QApplication::platformName() == "xcb"_L1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user