From bbb4efde187ec2a9546f2b9ff54e0db7d275fc5d Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 15 Jun 2024 11:34:37 +0200 Subject: Report errors from clock_gettime and clock_settime --- src/slack-timedate.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/slack-timedate.h') diff --git a/src/slack-timedate.h b/src/slack-timedate.h index 41eb0e7..2dd4223 100644 --- a/src/slack-timedate.h +++ b/src/slack-timedate.h @@ -47,12 +47,18 @@ namespace dlackware::timedate std::vector list_timezones(); // Sets the system time zone to the one passed by the argument - // Returns true on success, false otherwise + // Throws std::filesystem::filesystem_error. void set_timezone(const Glib::ustring& zone, bool user_interaction); // Sets NTP + // Throws std::filesystem::filesystem_error. void set_ntp(bool use_ntp, bool user_interaction); + // Changes the date/time + // Takes the amount of seconds since UNIX epoche and + // Throws std::system_error. + void set_time(gint64 seconds_since_epoch, bool relative, bool user_interaction); + class timedate1 { const Gio::DBus::InterfaceVTable interface_vtable; @@ -64,8 +70,3 @@ namespace dlackware::timedate void on_name_lost(const Glib::RefPtr& connection, const Glib::ustring& name); }; } - -// Changes the date/time -// Takes the amount of seconds since UNIX epoche and -// Returns true on success, false otherwise -gboolean slack_set_time(gint64 seconds_since_epoch, gboolean relative); -- cgit v1.2.3