wok-6.x diff libnotify/stuff/print-and-replace-id-v3.patch @ rev 20035
Add stm8flash
author | Xander Ziiryanoff <psychomaniak@xakep.ru> |
---|---|
date | Thu Aug 24 02:43:00 2017 +0200 (2017-08-24) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libnotify/stuff/print-and-replace-id-v3.patch Thu Aug 24 02:43:00 2017 +0200 1.3 @@ -0,0 +1,50 @@ 1.4 +https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/257135/comments/10 1.5 +https://launchpadlibrarian.net/105791133/print-and-replace-id-v3.patch 1.6 + 1.7 +Index: libnotify-0.7.5/tools/notify-send.c 1.8 +=================================================================== 1.9 +--- libnotify-0.7.5.orig/tools/notify-send.c 2011-10-14 11:24:15.000000000 +1300 1.10 ++++ libnotify-0.7.5/tools/notify-send.c 2012-05-22 22:15:43.370979671 +1200 1.11 +@@ -130,6 +130,8 @@ 1.12 + static char *icons = NULL; 1.13 + static char **n_text = NULL; 1.14 + static char **hints = NULL; 1.15 ++ static gboolean print_id = FALSE; 1.16 ++ static gint replace_id = 0; 1.17 + static gboolean do_version = FALSE; 1.18 + static gboolean hint_error = FALSE; 1.19 + static glong expire_timeout = NOTIFY_EXPIRES_DEFAULT; 1.20 +@@ -159,6 +161,10 @@ 1.21 + N_ 1.22 + ("Specifies basic extra data to pass. Valid types are int, double, string and byte."), 1.23 + N_("TYPE:NAME:VALUE")}, 1.24 ++ {"print-id", 'p', 0, G_OPTION_ARG_NONE, &print_id, 1.25 ++ N_ ("Print the notification ID."), NULL}, 1.26 ++ {"replace-id", 'r', 0, G_OPTION_ARG_INT, &replace_id, 1.27 ++ N_ ("The ID of the notification to replace."), N_("REPLACE_ID")}, 1.28 + {"version", 'v', 0, G_OPTION_ARG_NONE, &do_version, 1.29 + N_("Version of the package."), 1.30 + NULL}, 1.31 +@@ -233,6 +239,9 @@ 1.32 + 1.33 + g_free (body); 1.34 + 1.35 ++ if (replace_id) 1.36 ++ g_object_set (notify, "id", replace_id, NULL); 1.37 ++ 1.38 + /* Set hints */ 1.39 + if (hints != NULL) { 1.40 + gint i = 0; 1.41 +@@ -272,6 +281,12 @@ 1.42 + if (!hint_error) 1.43 + notify_notification_show (notify, NULL); 1.44 + 1.45 ++ if (print_id) { 1.46 ++ gint id; 1.47 ++ g_object_get (notify, "id", &id, NULL); 1.48 ++ g_printf ("%d\n", id); 1.49 ++ } 1.50 ++ 1.51 + g_object_unref (G_OBJECT (notify)); 1.52 + 1.53 + notify_uninit ();