[gnome-panel] launcher: comment might not be in initial data
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] launcher: comment might not be in initial data
- Date: Wed, 15 Apr 2020 22:11:43 +0000 (UTC)
commit a9c638ccfb95af71670e900b0698f6ef2a41d95a
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Apr 16 00:01:53 2020 +0300
launcher: comment might not be in initial data
Do not write garbage to key file.
modules/launcher/gp-launcher-applet.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/modules/launcher/gp-launcher-applet.c b/modules/launcher/gp-launcher-applet.c
index 48569946c..600b84df1 100644
--- a/modules/launcher/gp-launcher-applet.c
+++ b/modules/launcher/gp-launcher-applet.c
@@ -1342,6 +1342,12 @@ gp_launcher_applet_initial_setup (GpApplet *applet,
char *filename;
GError *error;
+ type = NULL;
+ icon = NULL;
+ name = NULL;
+ command = NULL;
+ comment = NULL;
+
g_variant_lookup (initial_settings, "type", "&s", &type);
g_variant_lookup (initial_settings, "icon", "&s", &icon);
g_variant_lookup (initial_settings, "name", "&s", &name);
@@ -1369,10 +1375,13 @@ gp_launcher_applet_initial_setup (GpApplet *applet,
G_KEY_FILE_DESKTOP_KEY_NAME,
name);
- g_key_file_set_string (file,
- G_KEY_FILE_DESKTOP_GROUP,
- G_KEY_FILE_DESKTOP_KEY_COMMENT,
- comment);
+ if (comment != NULL)
+ {
+ g_key_file_set_string (file,
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_COMMENT,
+ comment);
+ }
if (g_strcmp0 (type, "Application") == 0)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]