mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 05:38:06 -06:00
Rename literal operator
Qt 6.4 introduced `QString operator""_s()` and the previous `""_qs` is deprecated since Qt 6.8.
This commit is contained in:
@@ -42,17 +42,17 @@ DBusNotificationsInterface::DBusNotificationsInterface(const QString &service
|
||||
|
||||
QDBusPendingReply<QStringList> DBusNotificationsInterface::getCapabilities()
|
||||
{
|
||||
return asyncCall(u"GetCapabilities"_qs);
|
||||
return asyncCall(u"GetCapabilities"_s);
|
||||
}
|
||||
|
||||
QDBusPendingReply<QString, QString, QString, QString> DBusNotificationsInterface::getServerInformation()
|
||||
{
|
||||
return asyncCall(u"GetServerInformation"_qs);
|
||||
return asyncCall(u"GetServerInformation"_s);
|
||||
}
|
||||
|
||||
QDBusReply<QString> DBusNotificationsInterface::getServerInformation(QString &vendor, QString &version, QString &specVersion)
|
||||
{
|
||||
const QDBusMessage reply = call(QDBus::Block, u"GetServerInformation"_qs);
|
||||
const QDBusMessage reply = call(QDBus::Block, u"GetServerInformation"_s);
|
||||
if ((reply.type() == QDBusMessage::ReplyMessage) && (reply.arguments().count() == 4))
|
||||
{
|
||||
vendor = qdbus_cast<QString>(reply.arguments().at(1));
|
||||
@@ -67,10 +67,10 @@ QDBusPendingReply<uint> DBusNotificationsInterface::notify(const QString &appNam
|
||||
, const uint id, const QString &icon, const QString &summary, const QString &body
|
||||
, const QStringList &actions, const QVariantMap &hints, const int timeout)
|
||||
{
|
||||
return asyncCall(u"Notify"_qs, appName, id, icon, summary, body, actions, hints, timeout);
|
||||
return asyncCall(u"Notify"_s, appName, id, icon, summary, body, actions, hints, timeout);
|
||||
}
|
||||
|
||||
QDBusPendingReply<> DBusNotificationsInterface::closeNotification(const uint id)
|
||||
{
|
||||
return asyncCall(u"CloseNotification"_qs, id);
|
||||
return asyncCall(u"CloseNotification"_s, id);
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
|
||||
DBusNotifier::DBusNotifier(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_notificationsInterface {new DBusNotificationsInterface(u"org.freedesktop.Notifications"_qs
|
||||
, u"/org/freedesktop/Notifications"_qs, QDBusConnection::sessionBus(), this)}
|
||||
, m_notificationsInterface {new DBusNotificationsInterface(u"org.freedesktop.Notifications"_s
|
||||
, u"/org/freedesktop/Notifications"_s, QDBusConnection::sessionBus(), this)}
|
||||
{
|
||||
// Testing for 'DBusNotificationsInterface::isValid()' isn't helpful here.
|
||||
// If the notification daemon is configured to run 'as needed'
|
||||
@@ -58,10 +58,10 @@ DBusNotifier::DBusNotifier(QObject *parent)
|
||||
void DBusNotifier::showMessage(const QString &title, const QString &message, const int timeout)
|
||||
{
|
||||
// Assign "default" action to notification to make it clickable
|
||||
const QStringList actions {u"default"_qs, {}};
|
||||
const QVariantMap hints {{u"desktop-entry"_qs, u"org.qbittorrent.qBittorrent"_qs}};
|
||||
const QDBusPendingReply<uint> reply = m_notificationsInterface->notify(u"qBittorrent"_qs, 0
|
||||
, u"qbittorrent"_qs, title, message, actions, hints, timeout);
|
||||
const QStringList actions {u"default"_s, {}};
|
||||
const QVariantMap hints {{u"desktop-entry"_s, u"org.qbittorrent.qBittorrent"_s}};
|
||||
const QDBusPendingReply<uint> reply = m_notificationsInterface->notify(u"qBittorrent"_s, 0
|
||||
, u"qbittorrent"_s, title, message, actions, hints, timeout);
|
||||
auto *watcher = new QDBusPendingCallWatcher(reply, this);
|
||||
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this](QDBusPendingCallWatcher *self)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user