summaryrefslogtreecommitdiff
path: root/src/timedate.cpp
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2024-06-18 11:19:44 +0200
committerEugen Wissner <belka@caraus.de>2024-06-18 11:19:44 +0200
commit9dc8fb26405938834b13971c3188f4f52bb8b90d (patch)
tree72f770ee2c49d4f6ef9e90341d0c1bd6414fc942 /src/timedate.cpp
parent7b5fe4b9d1edf5d3eecc71bb0bf50ac0f4487f7e (diff)
downloadslack-timedate-9dc8fb26405938834b13971c3188f4f52bb8b90d.tar.gz
Generate path configuration file
Diffstat (limited to 'src/timedate.cpp')
-rw-r--r--src/timedate.cpp11
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)