Power profiles daemon: address review comments

Adding :
- A missing try/catch
- Glib::Error catch
- Remove the useless destructor
- Populate the profiles vector more efficiently
- Numerous nits
This commit is contained in:
Félix Baylac Jacqué
2024-03-01 19:37:20 +01:00
committed by Félix Baylac Jacqué
parent bddc870340
commit cc759a8b8f
2 changed files with 48 additions and 59 deletions

View File

@ -15,7 +15,6 @@ struct Profile {
class PowerProfilesDaemon : public ALabel {
public:
PowerProfilesDaemon(const std::string &, const Json::Value &);
~PowerProfilesDaemon() override;
auto update() -> void override;
void profileChangedCb(const Gio::DBus::Proxy::MapChangedProperties &,
const std::vector<Glib::ustring> &);
@ -38,12 +37,10 @@ class PowerProfilesDaemon : public ALabel {
std::vector<Profile>::iterator activeProfile_;
// Current CSS class applied to the label
std::string currentStyle_;
// Format strings
std::string labelFormat_;
// Format string
std::string tooltipFormat_;
// DBus Proxy used to track the current active profile
Glib::RefPtr<Gio::DBus::Proxy> powerProfilesProxy_;
sigc::connection powerProfileChangeSignal_;
};
} // namespace waybar::modules