Not adding the constructor causes a compilation error on Ubuntu 22.04
with both clang 14 and gcc 11:
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:518:4: error: no matching function for call to 'construct_at'
std::construct_at(__p, std::forward<_Args>(__args)...);
^~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/vector.tcc:117:21: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<waybar::modules::Profile>>::construct<waybar::modules::Profile, Glib::ustring, Glib::ustring>' requested here
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
^
../src/modules/power_profiles_daemon.cpp:106:26: note: in instantiation of function template specialization 'std::vector<waybar::modules::Profile>::emplace_back<Glib::ustring, Glib::ustring>' requested here
availableProfiles_.emplace_back(std::move(name), std::move(driver));
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_construct.h:94:5: note: candidate template ignored: substitution failure [with _Tp = waybar::modules::Profile, _Args = <Glib::ustring, Glib::ustring>]: no matching constructor for initialization of 'waybar::modules::Profile'
construct_at(_Tp* __location, _Args&&... __args)
^
The WP component loader API has changed to be asynchronous, so implement a (GAsyncReadyCallback)-based loader to manage them. Logging integration change was required for 0.5.0 RCs but not for the 0.5.0 release.
Fix clang-tidy and clang-format warnings. Note these are significantly wider than the changes for 0.5.0 so optional beyond the existing patchset.
Add secondary CSS class based on the 'warning_level' field reported by UPower
over D-Bus. This makes it possible to add custom styling when the battery is
near empty.
2 changes to address the review feedback:
1. Aleksei pointed out in this
comment (https://github.com/Alexays/Waybar/pull/2971#issuecomment-1972364896)
that there's no way to tell if a proxy is alive other than trying to
call a method on it. We perform a little dance to check whether or
not power-profiles-daemon is available on the system by calling
properties.GetAll. If something responds, we assume
power-profiles-daemon is installed, it's then safe to draw the
widget and attach the callback to the active profile.
2. We replaced all the synchronous DBus operations by their async
counterparts.