fix: lint

This commit is contained in:
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 {
class IdleInhibitor : public ALabel {
sigc::connection timeout_;
sigc::connection timeout_;
public:
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();
int timeoutSecs = timeoutMins * 60;
timeout_ = Glib::signal_timeout().connect_seconds([]() {
/* 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;
for (auto const& module : waybar::modules::IdleInhibitor::modules) {
module->update();
}
/* disconnect */
return false;
}, timeoutSecs);
timeout_ = Glib::signal_timeout().connect_seconds(
[]() {
/* 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;
for (auto const& module : waybar::modules::IdleInhibitor::modules) {
module->update();
}
/* disconnect */
return false;
},
timeoutSecs);
}
// Make all other idle inhibitor modules update