summaryrefslogtreecommitdiff
path: root/src/notification.c
diff options
context:
space:
mode:
authorLogan Rathbone <poprocks@gmail.com>2022-01-12 01:28:20 -0500
committerLogan Rathbone <poprocks@gmail.com>2022-01-12 01:28:20 -0500
commitc686bdb1b45e95acf010efd9ca0c75527fbb4dea (patch)
treee282c7e781d10d5e4a2fcfcf4cddccb6a9dac20c /src/notification.c
parentf139f34c514baa09100f3fd9ad556428c7d33e6f (diff)
downloadzenity-c686bdb1b45e95acf010efd9ca0c75527fbb4dea.tar.gz
Icon handling improvements.
Update manpage to reflect proper usage of --icon. Add handling of zenity3 --window-icon option, with deprecation warning.
Diffstat (limited to 'src/notification.c')
-rw-r--r--src/notification.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/notification.c b/src/notification.c
index 75c3035..dc25e59 100644
--- a/src/notification.c
+++ b/src/notification.c
@@ -51,8 +51,6 @@ zenity_notification_new (char *message, char *icon_path)
{
g_autoptr (GNotification) notif;
g_auto(GStrv) text = NULL;
- g_autoptr(GFile) icon_file = NULL;
- g_autoptr(GIcon) icon = NULL;
/* Accept a title and optional body in the form of `my title\nmy body'.
* The way this is displayed by the notification system is implementation
@@ -72,20 +70,9 @@ zenity_notification_new (char *message, char *icon_path)
if (icon_path)
{
- icon_file = g_file_new_for_path (icon_path);
-
- if (g_file_query_exists (icon_file, NULL))
- {
- icon = g_file_icon_new (icon_file);
- }
- else
- {
- g_debug (_("Icon filename %s not found; trying theme icon."),
- icon_path);
- icon = g_themed_icon_new_with_default_fallbacks (icon_path);
-// icon = g_themed_icon_new (icon_path);
- }
+ g_autoptr(GIcon) icon = NULL;
+ icon = zenity_util_gicon_from_string (icon_path);
g_notification_set_icon (notif, icon);
}