summaryrefslogtreecommitdiff
path: root/libmenu
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-01-01 21:35:57 +0100
committerLuke from DC <[email protected]>2021-01-05 16:09:12 +0000
commit55b720e5ab69eeea2cde12866a1ee7700d773bb2 (patch)
tree8d6984de444d478e1364313354eb8425fbe21245 /libmenu
parent301e0d1aeb84aacea17a1c934ff847afd1393a68 (diff)
downloadmate-menus-55b720e5ab69eeea2cde12866a1ee7700d773bb2.tar.bz2
mate-menus-55b720e5ab69eeea2cde12866a1ee7700d773bb2.tar.xz
Remove the cppcheck warning about the variable scope can be reduced
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/matemenu-tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmenu/matemenu-tree.c b/libmenu/matemenu-tree.c
index 6ab6526..0ee7502 100644
--- a/libmenu/matemenu-tree.c
+++ b/libmenu/matemenu-tree.c
@@ -653,8 +653,6 @@ load_object (char *id,
char *object_path;
GSettings *settings;
char *location;
- char **str;
- char *desktop_name;
object_path = g_strdup_printf ("/org/mate/panel/objects/%s/", id);
settings = g_settings_new_with_path ("org.mate.panel.object", object_path);
@@ -668,6 +666,9 @@ load_object (char *id,
basename = g_path_get_basename (location);
if (strstr (basename, "-1.") != NULL )
{
+ char **str;
+ char *desktop_name;
+
str = g_strsplit (basename, "-1.", -1);
desktop_name = g_strdup_printf ("%s.%s", str[0], str[1]);
g_ptr_array_add (self->collection_applet, desktop_name);