[Xfce4-commits] <midori:master> Use notify-send only as a fallback if libnotify is not available
Christian Dywan
noreply at xfce.org
Mon Jan 25 21:44:01 CET 2010
Updating branch refs/heads/master
to 4854cfab5d40f11b13a6efc212892e46210a6ffb (commit)
from 2f7dc55af70e794108bd35d944af743f39b1afa6 (commit)
commit 4854cfab5d40f11b13a6efc212892e46210a6ffb
Author: Alexander Butenko <a.butenka at gmail.com>
Date: Mon Jan 25 21:27:07 2010 +0100
Use notify-send only as a fallback if libnotify is not available
midori/midori-app.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/midori/midori-app.c b/midori/midori-app.c
index 6a8a0f0..297e25b 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
}
More information about the Xfce4-commits
mailing list