Skip to content

Commit

Permalink
sync: from linuxdeepin/qt5integration
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/qt5integration.

Source-pull-request: linuxdeepin/qt5integration#257
  • Loading branch information
deepin-ci-robot authored and 18202781743 committed Jan 14, 2025
1 parent c6dcb4a commit 22ac4c9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions 3rdparty/qdbustrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ static QString iconTempPath()
return QDir::tempPath();
}

static const QString KDEItemFormat = QStringLiteral("org.kde.StatusNotifierItem-%1-%2")
.arg(QDBusConnection::sessionBus().baseService().replace(
QRegularExpression(QStringLiteral("[\\.:]")), QStringLiteral("_")));

// delay to access dbus.
static QString KDEItemFormat()
{
static const QString KDEItemFormat = QStringLiteral("org.kde.StatusNotifierItem-%1-%2")
.arg(QDBusConnection::sessionBus().baseService().replace(
QRegularExpression(QStringLiteral("[\\.:]")), QStringLiteral("_")));
return KDEItemFormat;
}
static const QString KDEWatcherService = QStringLiteral("org.kde.StatusNotifierWatcher");
static const QString XdgNotificationService = QStringLiteral("org.freedesktop.Notifications");
static const QString XdgNotificationPath = QStringLiteral("/org/freedesktop/Notifications");
Expand All @@ -83,7 +87,7 @@ QDBusTrayIcon::QDBusTrayIcon()
, m_menuAdaptor(nullptr)
, m_menu(nullptr)
, m_notifier(nullptr)
, m_instanceId(KDEItemFormat.arg(instanceCount))
, m_instanceId(KDEItemFormat().arg(instanceCount))
, m_category(QStringLiteral("ApplicationStatus"))
, m_defaultStatus(QStringLiteral("Active")) // be visible all the time. QSystemTrayIcon has no API to control this.
, m_status(m_defaultStatus)
Expand Down

0 comments on commit 22ac4c9

Please sign in to comment.