[libnotify: 1/2] notify-send: Support commas in icon filenames
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libnotify: 1/2] notify-send: Support commas in icon filenames
- Date: Fri, 26 Mar 2021 15:57:35 +0000 (UTC)
commit dfaa76109ebfefc669918e4a6b0d09899ddb332d
Author: Thorsten Wißmann <edu thorsten-wissmann de>
Date: Mon Dec 7 20:22:15 2020 +0100
notify-send: Support commas in icon filenames
Do not cut off an icon filename (passed to -i) at the first comma
character. The original motivation probably was to support a list of
icon names in -i separated by comma. However, this has never been
implemented and the help text for -i also only mentions "an icon".
Hence, no functionality is lost by this change. In contrast, -i now
supports commas in icon filepaths.
https://gitlab.gnome.org/GNOME/libnotify/-/issues/16
docs/notify-send.xml | 2 +-
tools/notify-send.c | 15 ++-------------
2 files changed, 3 insertions(+), 14 deletions(-)
---
diff --git a/docs/notify-send.xml b/docs/notify-send.xml
index 614b48b..7372507 100644
--- a/docs/notify-send.xml
+++ b/docs/notify-send.xml
@@ -73,7 +73,7 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><option>-i</option>,
<option>--icon</option>=<replaceable>ICON</replaceable>[,<replaceable>ICON</replaceable>…]
+ <term><option>-i</option>, <option>--icon</option>=<replaceable>ICON</replaceable>
</term>
<listitem>
<para>Specifies an icon filename or stock icon to display.</para>
diff --git a/tools/notify-send.c b/tools/notify-send.c
index 67e0b03..9b8e438 100644
--- a/tools/notify-send.c
+++ b/tools/notify-send.c
@@ -128,7 +128,6 @@ main (int argc, char *argv[])
static const char *type = NULL;
static char *app_name = NULL;
static char *icon_str = NULL;
- static char *icons = NULL;
static char **n_text = NULL;
static char **hints = NULL;
static gboolean do_version = FALSE;
@@ -150,9 +149,9 @@ main (int argc, char *argv[])
"notification."), N_("TIME")},
{"app-name", 'a', 0, G_OPTION_ARG_STRING, &app_name,
N_("Specifies the app name for the icon"), N_("APP_NAME")},
- {"icon", 'i', 0, G_OPTION_ARG_FILENAME, &icons,
+ {"icon", 'i', 0, G_OPTION_ARG_FILENAME, &icon_str,
N_("Specifies an icon filename or stock icon to display."),
- N_("ICON[,ICON...]")},
+ N_("ICON")},
{"category", 'c', 0, G_OPTION_ARG_FILENAME, &type,
N_("Specifies the notification category."),
N_("TYPE[,TYPE...]")},
@@ -215,16 +214,6 @@ main (int argc, char *argv[])
}
}
- if (icons != NULL) {
- char *c;
-
- /* XXX */
- if ((c = strchr (icons, ',')) != NULL)
- *c = '\0';
-
- icon_str = icons;
- }
-
if (!notify_init ("notify-send"))
exit (1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]