feat(Tray): handle item unregister

This commit is contained in:
Alexis
2018-09-04 23:50:08 +02:00
parent fc6e42d748
commit 20ff2cab9e
12 changed files with 127 additions and 107 deletions

View File

@ -1,6 +1,7 @@
#pragma once
#include <gtkmm.h>
#include <tuple>
#include <dbus-status-notifier-watcher.h>
#include "modules/sni/sni.hpp"
@ -8,8 +9,7 @@ namespace waybar::modules::SNI {
class Host {
public:
Host(Glib::Dispatcher&);
~Host();
Host(Glib::Dispatcher*);
std::vector<Item> items;
private:
static void busAcquired(GDBusConnection*, const gchar*, gpointer);
@ -23,14 +23,14 @@ class Host {
static void itemUnregistered(SnOrgKdeStatusNotifierWatcher*, const gchar*,
gpointer);
void getBusNameAndObjectPath(const gchar*, gchar**, gchar**);
std::tuple<std::string, std::string> getBusNameAndObjectPath(const gchar*);
void addRegisteredItem(const gchar* service);
uint32_t bus_name_id_;
uint32_t watcher_id_;
std::string bus_name_;
std::string object_path_;
Glib::Dispatcher& dp_;
Glib::Dispatcher* dp_;
GCancellable* cancellable_ = nullptr;
SnOrgKdeStatusNotifierWatcher* watcher_ = nullptr;
};