summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2020-02-20 13:40:08 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2020-02-20 16:55:35 +0100
commit6e77c4aae21877d039ca81a18ce3b33950f911c7 (patch)
treeb5f8dbab34bb94ff9a7dc8fddb2238dd045e3d68
parentf3076c6d1951a8e66f3be74e1a0c53d9b34d6cb0 (diff)
homescreen: Do not show apps that do not want to be showndevs/xartigas/homescreen_example
As mandated by the .desktop files. Otherwise, you might get missing icons.
-rw-r--r--apps/c/homescreen/src/homescreen.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/c/homescreen/src/homescreen.c b/apps/c/homescreen/src/homescreen.c
index 1b2eb087..304b63e1 100644
--- a/apps/c/homescreen/src/homescreen.c
+++ b/apps/c/homescreen/src/homescreen.c
@@ -75,7 +75,7 @@ _parse_desktop_file(const char *desktop_file_path, char **app_name, char **app_c
75 if (!desktop_file) 75 if (!desktop_file)
76 return 0; 76 return 0;
77 77
78 char *name = NULL, *command = NULL, *icon = NULL; 78 char *name = NULL, *command = NULL, *icon = NULL, *onlyshow = NULL, *nodisplay = NULL;
79 while (!efl_io_reader_eos_get(desktop_file) && 79 while (!efl_io_reader_eos_get(desktop_file) &&
80 efl_io_reader_read(desktop_file, &slice) == EINA_ERROR_NO_ERROR) 80 efl_io_reader_read(desktop_file, &slice) == EINA_ERROR_NO_ERROR)
81 { 81 {
@@ -87,10 +87,12 @@ _parse_desktop_file(const char *desktop_file_path, char **app_name, char **app_c
87 _parse_token(ptr, "Name=", &name); 87 _parse_token(ptr, "Name=", &name);
88 _parse_token(ptr, "Exec=", &command); 88 _parse_token(ptr, "Exec=", &command);
89 _parse_token(ptr, "Icon=", &icon); 89 _parse_token(ptr, "Icon=", &icon);
90 _parse_token(ptr, "OnlyShowIn=", &onlyshow);
91 _parse_token(ptr, "NoDisplay=", &nodisplay);
90 } 92 }
91 free(content); 93 free(content);
92 } 94 }
93 if (name && command && icon) 95 if (name && command && icon && !onlyshow && (!nodisplay || eina_streq(nodisplay, "false")))
94 { 96 {
95 *app_name = name; 97 *app_name = name;
96 *app_command = command; 98 *app_command = command;
@@ -106,6 +108,10 @@ _parse_desktop_file(const char *desktop_file_path, char **app_name, char **app_c
106 if (icon) 108 if (icon)
107 free(icon); 109 free(icon);
108 } 110 }
111 if (onlyshow)
112 free(onlyshow);
113 if (nodisplay)
114 free(nodisplay);
109 115
110 efl_unref(desktop_file); 116 efl_unref(desktop_file);
111 117