From 4854cfab5d40f11b13a6efc212892e46210a6ffb Mon Sep 17 00:00:00 2001 From: Alexander Butenko Date: Mon, 25 Jan 2010 21:27:07 +0100 Subject: [PATCH] Use notify-send only as a fallback if libnotify is not available --- midori/midori-app.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/midori/midori-app.c b/midori/midori-app.c index 6a8a0f08..297e25b6 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -62,7 +62,7 @@ struct _MidoriApp MidoriAppInstance instance; - #if !HAVE_HILDON + #if !HAVE_HILDON || !HAVE_LIBNOTIFY gchar* program_notify_send; #endif }; @@ -714,9 +714,10 @@ midori_app_init (MidoriApp* app) #if HAVE_LIBNOTIFY notify_init ("midori"); + #else + app->program_notify_send = g_find_program_in_path ("notify-send"); #endif - app->program_notify_send = g_find_program_in_path ("notify-send"); } static void @@ -747,8 +748,9 @@ midori_app_finalize (GObject* object) #if HAVE_LIBNOTIFY if (notify_is_initted ()) notify_uninit (); + #else + katze_assign (app->program_notify_send, NULL); #endif - katze_assign (app->program_notify_send, NULL); G_OBJECT_CLASS (midori_app_parent_class)->finalize (object); } @@ -1173,8 +1175,7 @@ midori_app_send_notification (MidoriApp* app, sent = notify_notification_show (note, NULL); g_object_unref (note); } - #endif - + #else /* Fall back to the command line program "notify-send" */ if (!sent && app->program_notify_send) { @@ -1190,4 +1191,5 @@ midori_app_send_notification (MidoriApp* app, g_free (command); } #endif + #endif }