From 1d96d57b75a6695696ad8638950b3bde3d1d4951 Mon Sep 17 00:00:00 2001 From: Alexis Date: Mon, 3 Dec 2018 09:35:10 +0100 Subject: [PATCH] feat: warn user about stopped endless custom module --- include/modules/sni/tray.hpp | 2 +- src/factory.cpp | 2 +- src/modules/custom.cpp | 1 + src/modules/sni/tray.cpp | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/modules/sni/tray.hpp b/include/modules/sni/tray.hpp index a6c9a977..2f79f927 100644 --- a/include/modules/sni/tray.hpp +++ b/include/modules/sni/tray.hpp @@ -12,7 +12,7 @@ namespace waybar::modules::SNI { class Tray : public IModule { public: - Tray(const Bar& bar, const Json::Value&); + Tray(const Json::Value&); auto update() -> void; operator Gtk::Widget &(); private: diff --git a/src/factory.cpp b/src/factory.cpp index 923cf4d5..a72d938c 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -33,7 +33,7 @@ waybar::IModule* waybar::Factory::makeModule(const std::string &name) const } #ifdef HAVE_DBUSMENU if (ref == "tray") { - return new waybar::modules::SNI::Tray(bar_, config_[name]); + return new waybar::modules::SNI::Tray(config_[name]); } #endif #ifdef HAVE_LIBNL diff --git a/src/modules/custom.cpp b/src/modules/custom.cpp index 74ae0f25..4c57f963 100644 --- a/src/modules/custom.cpp +++ b/src/modules/custom.cpp @@ -49,6 +49,7 @@ void waybar::modules::Custom::continuousWorker() pclose(fp); thread_.stop(); output_ = { 1, "" }; + std::cerr << name_ " just stopped, is it endless?" << std::endl; dp.emit(); return; } diff --git a/src/modules/sni/tray.cpp b/src/modules/sni/tray.cpp index ffc59057..6b974648 100644 --- a/src/modules/sni/tray.cpp +++ b/src/modules/sni/tray.cpp @@ -2,7 +2,7 @@ #include -waybar::modules::SNI::Tray::Tray(const Bar& bar, const Json::Value &config) +waybar::modules::SNI::Tray::Tray(const Json::Value &config) : config_(config), watcher_(), host_(nb_hosts_, config, std::bind(&Tray::onAdd, this, std::placeholders::_1), std::bind(&Tray::onRemove, this, std::placeholders::_1))