forked from quickshell/quickshell
dbus/dbusmenu: separate menu handles from status notifier items
No api changes yet.
This commit is contained in:
parent
a71a6fb3ac
commit
acdbe73c10
6 changed files with 157 additions and 60 deletions
|
@ -157,4 +157,35 @@ public:
|
|||
QByteArray data;
|
||||
};
|
||||
|
||||
class DBusMenuHandle;
|
||||
|
||||
QDebug operator<<(QDebug debug, const DBusMenuHandle* handle);
|
||||
|
||||
class DBusMenuHandle: public menu::QsMenuHandle {
|
||||
Q_OBJECT;
|
||||
QML_ELEMENT;
|
||||
QML_UNCREATABLE("");
|
||||
|
||||
public:
|
||||
explicit DBusMenuHandle(QObject* parent): menu::QsMenuHandle(parent) {}
|
||||
|
||||
void setAddress(const QString& service, const QString& path);
|
||||
|
||||
void ref() override;
|
||||
void unref() override;
|
||||
|
||||
[[nodiscard]] QsMenuEntry* menu() const override;
|
||||
|
||||
private:
|
||||
void onMenuPathChanged();
|
||||
|
||||
QString service;
|
||||
QString path;
|
||||
DBusMenu* mMenu = nullptr;
|
||||
bool loaded = false;
|
||||
quint32 refcount = 0;
|
||||
|
||||
friend QDebug operator<<(QDebug debug, const DBusMenuHandle* handle);
|
||||
};
|
||||
|
||||
} // namespace qs::dbus::dbusmenu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue