From f466538a3527cd539c732d3abee481fa7a34fc2f Mon Sep 17 00:00:00 2001 From: Sebastian Reichel Date: Thu, 28 Jun 2018 01:03:02 +0200 Subject: all: Add DBusError to avoid warnings with valac 0.40 --- src/curses-ui/main.vala | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/curses-ui') diff --git a/src/curses-ui/main.vala b/src/curses-ui/main.vala index 47be40a..7c2e762 100644 --- a/src/curses-ui/main.vala +++ b/src/curses-ui/main.vala @@ -23,6 +23,8 @@ private static void play(string file) { audio.play_system(file); } catch(IOError e) { ui.log(MessageType.WARNING, "could not play audio: %s".printf(e.message)); + } catch(DBusError e) { + ui.log(MessageType.WARNING, "could not play audio: %s".printf(e.message)); } } @@ -43,8 +45,8 @@ public static int main(string[] args) { loop = new MainLoop(); /* handle unix signals */ - Unix.signal_add(Posix.SIGTERM, handle_signals); - Unix.signal_add(Posix.SIGINT, handle_signals); + Unix.signal_add(Posix.Signal.TERM, handle_signals); + Unix.signal_add(Posix.Signal.INT, handle_signals); try { audio = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.AudioPlayer", "/io/mainframe/shopsystem/audio"); @@ -62,16 +64,7 @@ public static int main(string[] args) { scanner.msg.connect(msg_handler); scanner.msg_overlay.connect(msg_overlay_handler); - /* get configuration */ - Config config = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config"); - var shopname = "--SHOPNAME--"; - try { - shopname = config.get_string("GENERAL", "longname"); - } catch(KeyFileError e) { - shopname = "Missing in Config"; - } - - ui.log(MessageType.INFO, "KtT Shop System has been started"); + ui.log(MessageType.INFO, "Shop System has been started"); play("startup.ogg"); /* run mainloop */ -- cgit v1.2.3