mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor: format && better output management
This commit is contained in:
@ -16,7 +16,19 @@ Host::Host(const std::size_t id, const Json::Value& config,
|
||||
on_add_(on_add),
|
||||
on_remove_(on_remove) {}
|
||||
|
||||
Host::~Host() { Gio::DBus::unwatch_name(bus_name_id_); }
|
||||
Host::~Host() {
|
||||
if (bus_name_id_ > 0) {
|
||||
Gio::DBus::unwatch_name(bus_name_id_);
|
||||
bus_name_id_ = 0;
|
||||
}
|
||||
if (watcher_id_ > 0) {
|
||||
Gio::DBus::unwatch_name(watcher_id_);
|
||||
watcher_id_ = 0;
|
||||
}
|
||||
g_cancellable_cancel(cancellable_);
|
||||
g_clear_object(&cancellable_);
|
||||
g_clear_object(&watcher_);
|
||||
}
|
||||
|
||||
void Host::busAcquired(const Glib::RefPtr<Gio::DBus::Connection>& conn, Glib::ustring name) {
|
||||
watcher_id_ = Gio::DBus::watch_name(conn, "org.kde.StatusNotifierWatcher",
|
||||
|
@ -8,7 +8,6 @@ waybar::modules::SNI::Tray::Tray(const std::string& id, const Bar& bar, const Js
|
||||
watcher_(),
|
||||
host_(nb_hosts_, config, std::bind(&Tray::onAdd, this, std::placeholders::_1),
|
||||
std::bind(&Tray::onRemove, this, std::placeholders::_1)) {
|
||||
std::cout << "Tray is in beta, so there may be bugs or even be unusable." << std::endl;
|
||||
if (config_["spacing"].isUInt()) {
|
||||
box_.set_spacing(config_["spacing"].asUInt());
|
||||
}
|
||||
|
Reference in New Issue
Block a user