Also fixed timezones behavior: now waybar starting with the first timezone in timezones list and falling back to timezone field only if timezones omit or has no elements.
We are currently using this value once before it's initialized, since we
check it before we set it in Clock::calendar_text(). This was caught by
Valgrind, producing the following error:
==8962== Conditional jump or move depends on uninitialised value(s)
==8962== at 0x138285: date::operator==(date::year_month_day const&, date::year_month_day const&) (date.h:2793)
==8962== by 0x135F11: waybar::modules::Clock::calendar_text[abi:cxx11](waybar::modules::waybar_time const&) (clock.cpp:111)
==8962== by 0x13587C: waybar::modules::Clock::update() (clock.cpp:62)
==8962== by 0x156EFA: waybar::Bar::getModules(waybar::Factory const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda()#1}::operator()() const (bar.cpp:577)
==8962== by 0x157F39: sigc::adaptor_functor<waybar::Bar::getModules(waybar::Factory const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda()#1}>::operator()() const (adaptor_trait.h:256)
==8962== by 0x157D94: sigc::internal::slot_call0<waybar::Bar::getModules(waybar::Factory const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda()#1}, void>::call_it(sigc::internal::slot_rep*) (slot.h:136)
==8962== by 0x5177B21: Glib::DispatchNotifier::pipe_io_handler(Glib::IOCondition) (in /usr/lib/libglibmm-2.4.so.1.3.0)
==8962== by 0x517DB5B: Glib::IOSource::dispatch(sigc::slot_base*) (in /usr/lib/libglibmm-2.4.so.1.3.0)
==8962== by 0x5188B96: Glib::Source::dispatch_vfunc(_GSource*, int (*)(void*), void*) (in /usr/lib/libglibmm-2.4.so.1.3.0)
==8962== by 0x5CBC913: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.6600.2)
==8962== by 0x5D107D0: ??? (in /usr/lib/libglib-2.0.so.0.6600.2)
==8962== by 0x5CBB120: g_main_context_iteration (in /usr/lib/libglib-2.0.so.0.6600.2)
Initialize the value to prevent the error.
In file included from ../src/factory.cpp:1:
In file included from ../include/factory.hpp:4:
../include/modules/clock.hpp:5:10: fatal error: 'fmt/time.h' file not found
#include "fmt/time.h"
^~~~~~~~~~~~
In file included from ../src/bar.cpp:4:
In file included from ../include/factory.hpp:4:
In file included from ../include/modules/clock.hpp:3:
In file included from /usr/include/fmt/chrono.h:12:
/usr/include/fmt/locale.h:19:35: error: parameter type 'fmt::v5::internal::buffer' (aka 'basic_buffer<char>') is an abstract class
const std::locale& loc, buffer<Char>& buf,
^
/usr/include/spdlog/fmt/bundled/core.h:238:16: note: unimplemented pure virtual method 'grow' in 'basic_buffer'
virtual void grow(std::size_t capacity) = 0;
^
In file included from ../src/modules/sni/host.cpp:3:
/usr/include/fmt/ostream.h:22:9: error: expected member name or ';' after declaration specifiers
buffer<Char>& buffer_;
~~~~~~^
/usr/include/fmt/ostream.h:25:19: error: expected ')'
formatbuf(buffer<Char>& buf) : buffer_(buf) {}
^
/usr/include/fmt/ostream.h:25:12: note: to match this '('
formatbuf(buffer<Char>& buf) : buffer_(buf) {}
^
/usr/include/fmt/ostream.h:25:42: error: use of undeclared identifier 'buf'; did you mean 'prettify_handler::buf'?
formatbuf(buffer<Char>& buf) : buffer_(buf) {}
^~~
prettify_handler::buf
/usr/include/spdlog/fmt/bundled/format-inl.h:551:11: note: 'prettify_handler::buf' declared here
buffer &buf;
^