False positive, fixed by assigning to an attribute. Seems like
clang-tidy really doesn't like ephemeral objects even if they
have a parent.
connect(this, SIGNAL(toolTipChanged(QString, QString)), _statusNotifierItemDBus, SIGNAL(NewToolTip()));
// Service watcher to keep track of the StatusNotifierWatcher service
connect(this, SIGNAL(toolTipChanged(QString, QString)), _statusNotifierItemDBus, SIGNAL(NewToolTip()));
// Service watcher to keep track of the StatusNotifierWatcher service
- QDBusServiceWatcher *watcher = new QDBusServiceWatcher(kSniWatcherService,
- QDBusConnection::sessionBus(),
- QDBusServiceWatcher::WatchForOwnerChange,
- this);
- connect(watcher, SIGNAL(serviceOwnerChanged(QString, QString, QString)), SLOT(serviceChange(QString, QString, QString)));
+ _serviceWatcher = new QDBusServiceWatcher(kSniWatcherService,
+ QDBusConnection::sessionBus(),
+ QDBusServiceWatcher::WatchForOwnerChange,
+ this);
+ connect(_serviceWatcher, SIGNAL(serviceOwnerChanged(QString, QString, QString)), SLOT(serviceChange(QString, QString, QString)));
// Client instance for StatusNotifierWatcher
_statusNotifierWatcher = new org::kde::StatusNotifierWatcher(kSniWatcherService,
// Client instance for StatusNotifierWatcher
_statusNotifierWatcher = new org::kde::StatusNotifierWatcher(kSniWatcherService,
# include "legacysystemtray.h"
#endif
# include "legacysystemtray.h"
#endif
+class QDBusServiceWatcher;
+
class StatusNotifierItemDBus;
class StatusNotifierItem : public StatusNotifierItemParent
class StatusNotifierItemDBus;
class StatusNotifierItem : public StatusNotifierItemParent
private:
void registerToWatcher();
private:
void registerToWatcher();
+ QDBusServiceWatcher *_serviceWatcher{nullptr};
StatusNotifierItemDBus *_statusNotifierItemDBus{nullptr};
org::kde::StatusNotifierWatcher *_statusNotifierWatcher{nullptr};
org::freedesktop::Notifications *_notificationsClient{nullptr};
StatusNotifierItemDBus *_statusNotifierItemDBus{nullptr};
org::kde::StatusNotifierWatcher *_statusNotifierWatcher{nullptr};
org::freedesktop::Notifications *_notificationsClient{nullptr};