diff options
Diffstat (limited to 'src/timedate.cpp')
| -rw-r--r-- | src/timedate.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/timedate.cpp b/src/timedate.cpp index a320384..b06cbcc 100644 --- a/src/timedate.cpp +++ b/src/timedate.cpp @@ -120,6 +120,9 @@ static void slack_get_property(Glib::VariantBase& result, const Glib::RefPtr<Gio namespace dlackware::timedate { + constexpr const std::int32_t usec_per_sec = 1000000ULL; + constexpr const std::int32_t nsec_per_usec = 1000ULL; + timedate1::timedate1() : interface_vtable{ &slack_method_call, &slack_get_property } { @@ -134,11 +137,11 @@ namespace dlackware::timedate void timedate1::on_bus_acquired(const Glib::RefPtr<Gio::DBus::Connection>& connection, const Glib::ustring& name) { Glib::RefPtr<Gio::DBus::NodeInfo> introspection_data; - try { - auto introspection_xml = Glib::file_get_contents(dlackware::timedate::introspection_xml); - + auto introspection_xml = Glib::file_get_contents( + (std::filesystem::path(DATADIR_INTERFACES) / dlackware::timedate::bus_name).concat(".xml") + ); introspection_data = Gio::DBus::NodeInfo::create_for_xml(introspection_xml); } catch (Glib::Error& slack_err) @@ -194,7 +197,7 @@ namespace dlackware::timedate { return nullptr; } - return Glib::ustring{ zone_copied_from.get() + strlen(zoneinfo_database) + 1 }; + return Glib::ustring{ zone_copied_from.get() + zoneinfo_database.size() + 1 }; } void set_timezone(const Glib::ustring& zone, bool) |
