From 49fb8280c3a09953f0ef401541a695e8ae999dc1 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 27 Apr 2013 17:28:25 +0200 Subject: set properties only once --- netlink-notify.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netlink-notify.c b/netlink-notify.c index 31e6b87..9e1b50c 100644 --- a/netlink-notify.c +++ b/netlink-notify.c @@ -215,16 +215,16 @@ static int msg_handler (struct sockaddr_nl *nl, struct nlmsghdr *msg) { return 0; } - if (notification[ifi->ifi_index] == NULL) + if (notification[ifi->ifi_index] == NULL) { notification[ifi->ifi_index] = notify_notification_new(TEXT_TOPIC, notifystr, (ifi->ifi_flags & CHECK_CONNECTED ? ICON_NETWORK_CONNECTED : ICON_NETWORK_DISCONNECTED)); - else + notify_notification_set_category(notification[ifi->ifi_index], PROGNAME); + notify_notification_set_urgency(notification[ifi->ifi_index], NOTIFY_URGENCY_NORMAL); + } else notify_notification_update(notification[ifi->ifi_index], TEXT_TOPIC, notifystr, (ifi->ifi_flags & CHECK_CONNECTED ? ICON_NETWORK_CONNECTED : ICON_NETWORK_DISCONNECTED)); notify_notification_set_timeout(notification[ifi->ifi_index], NOTIFICATION_TIMEOUT); - notify_notification_set_category(notification[ifi->ifi_index], PROGNAME); - notify_notification_set_urgency(notification[ifi->ifi_index], NOTIFY_URGENCY_NORMAL); while (!notify_notification_show (notification[ifi->ifi_index], &error)) { if (errcount > 1) { -- cgit v1.2.3-70-g09d2