From 05d8f386a05f1a4273ee36bf364c9186c0603423 Mon Sep 17 00:00:00 2001 From: short <> Date: Sun, 26 Jun 2005 04:04:35 +0000 Subject: [PATCH 1/1] +Sanity check+warn if the registrance on/off succeeded but did not turn. --- src/startup.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/startup.c b/src/startup.c index d8e1928..e2607c1 100644 --- a/src/startup.c +++ b/src/startup.c @@ -45,7 +45,15 @@ gboolean is_on; if (is_on==TRUE) return TRUE; - return (*UDPGATE_STARTUP_GET_CLASS(udpgate_startup)->on)(udpgate_startup); + if (!(*UDPGATE_STARTUP_GET_CLASS(udpgate_startup)->on)(udpgate_startup)) + return FALSE; + if (!udpgate_startup_query(udpgate_startup,&is_on)) + return FALSE; + if (is_on!=TRUE) { + g_warning(_("Error registering automatic program startup!")); + return FALSE; + } + return TRUE; } gboolean udpgate_startup_off(UdpgateStartup *udpgate_startup) @@ -59,7 +67,15 @@ gboolean is_on; if (is_on==FALSE) return TRUE; - return (*UDPGATE_STARTUP_GET_CLASS(udpgate_startup)->off)(udpgate_startup); + if (!(*UDPGATE_STARTUP_GET_CLASS(udpgate_startup)->off)(udpgate_startup)) + return FALSE; + if (!udpgate_startup_query(udpgate_startup,&is_on)) + return FALSE; + if (is_on!=FALSE) { + g_warning(_("Error removing program's system startup registrance!")); + return FALSE; + } + return TRUE; } UdpgateStartup *udpgate_startup_new(void) -- 1.8.3.1