diff options
author | rbuj <[email protected]> | 2021-01-10 20:32:55 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2021-01-26 21:17:10 +0100 |
commit | 1c989ea4e5ea375167a7646aaf4e6dbc1cf19446 (patch) | |
tree | 7b055036b6163cd63c27d8dcab3bbd372fe07c27 | |
parent | 8e3ecee06adc8e02e3daeb036f13da506c0c2d6a (diff) | |
download | mate-menus-1c989ea4e5ea375167a7646aaf4e6dbc1cf19446.tar.bz2 mate-menus-1c989ea4e5ea375167a7646aaf4e6dbc1cf19446.tar.xz |
matemenu-tree: do not call g_settings_get_string unless necessary
-rw-r--r-- | libmenu/matemenu-tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmenu/matemenu-tree.c b/libmenu/matemenu-tree.c index 87470b8..eb94ed3 100644 --- a/libmenu/matemenu-tree.c +++ b/libmenu/matemenu-tree.c @@ -656,20 +656,20 @@ load_object (char *id, ObjectType object_type; char *object_path; GSettings *settings; - char *location; object_path = g_strdup_printf ("/org/mate/panel/objects/%s/", id); settings = g_settings_new_with_path ("org.mate.panel.object", object_path); object_type = g_settings_get_enum (settings, "object-type"); - location = g_settings_get_string (settings, "launcher-location"); if (object_type == OBJECT_LAUNCHER) { + char *location; char *desktop_name; if (self->collection_applet == NULL) self->collection_applet = g_ptr_array_new (); + location = g_settings_get_string (settings, "launcher-location"); desktop_name = g_path_get_basename (location); if (strstr (desktop_name, "-1.") != NULL ) { @@ -681,8 +681,8 @@ load_object (char *id, g_strfreev (str); } g_ptr_array_add (self->collection_applet, desktop_name); + g_free (location); } - g_free (location); g_free (object_path); g_object_unref (settings); } |