refactor(modules): prefer sigc::mem_fun

This commit is contained in:
Alexis
2018-08-11 02:40:13 +02:00
parent 14053d61fc
commit 04183dc696
8 changed files with 9 additions and 21 deletions

View File

@ -22,7 +22,7 @@ waybar::modules::Battery::Battery(Json::Value config)
_label.get_style_context()->add_class("battery");
int interval = _config["interval"] ? _config["inveral"].asInt() : 1;
_thread = [this, interval] {
update();
Glib::signal_idle().connect_once(sigc::mem_fun(*this, &Battery::update));
_thread.sleep_for(chrono::seconds(interval));
};
}