fix: lint

pull/1551/head
Alex 2022-05-04 17:29:08 +02:00
parent eec0a8255f
commit 7bbf7c99a3
2 changed files with 15 additions and 13 deletions

View File

@ -9,7 +9,7 @@
namespace waybar::modules { namespace waybar::modules {
class IdleInhibitor : public ALabel { class IdleInhibitor : public ALabel {
sigc::connection timeout_; sigc::connection timeout_;
public: public:
IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&); IdleInhibitor(const std::string&, const waybar::Bar&, const Json::Value&);

View File

@ -81,18 +81,20 @@ bool waybar::modules::IdleInhibitor::handleToggle(GdkEventButton* const& e) {
auto timeoutMins = config_["timeout"].asDouble(); auto timeoutMins = config_["timeout"].asDouble();
int timeoutSecs = timeoutMins * 60; int timeoutSecs = timeoutMins * 60;
timeout_ = Glib::signal_timeout().connect_seconds([]() { timeout_ = Glib::signal_timeout().connect_seconds(
/* intentionally not tied to a module instance lifetime []() {
* as the output with `this` can be disconnected /* intentionally not tied to a module instance lifetime
*/ * as the output with `this` can be disconnected
spdlog::info("deactivating idle_inhibitor by timeout"); */
status = false; spdlog::info("deactivating idle_inhibitor by timeout");
for (auto const& module : waybar::modules::IdleInhibitor::modules) { status = false;
module->update(); for (auto const& module : waybar::modules::IdleInhibitor::modules) {
} module->update();
/* disconnect */ }
return false; /* disconnect */
}, timeoutSecs); return false;
},
timeoutSecs);
} }
// Make all other idle inhibitor modules update // Make all other idle inhibitor modules update