aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-04-27 17:28:25 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-04-27 17:28:25 +0200
commit49fb8280c3a09953f0ef401541a695e8ae999dc1 (patch)
tree15dbe85fca79fe050fbd745f394b77b84205a77a
parent5d4caa6bc2e20b14e83d65a532e2ae1f43cc481b (diff)
downloadnetlink-notify-49fb8280c3a09953f0ef401541a695e8ae999dc1.tar.gz
netlink-notify-49fb8280c3a09953f0ef401541a695e8ae999dc1.tar.zst
set properties only once
-rw-r--r--netlink-notify.c8
1 files 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) {