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

@ -10,9 +10,7 @@ waybar::modules::Custom::Custom(std::string name, Json::Value config)
}
int interval = _config["interval"] ? _config["inveral"].asInt() : 30;
_thread = [this, interval] {
Glib::signal_idle().connect_once([this] {
update();
});
Glib::signal_idle().connect_once(sigc::mem_fun(*this, &Custom::update));
_thread.sleep_for(chrono::seconds(interval));
};
};