/* vim: set sw=4 ts=4 sts=4 et: */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <limits.h>
#include <stdio.h>
#include <dirent.h>
static Eina_Hash *paths = NULL;
static int
-cache_add(const char *path, const char *file_id, int priority)
+cache_add(const char *path, const char *file_id, int priority __UNUSED__)
{
Efreet_Desktop *desk;
char *ext;
return 0;
eina_hash_add(paths, desk->orig_path, (void *)1);
}
+ /* TODO: We should check priority, and not just hope we search in right order */
if (file_id && !eina_hash_find(file_ids, file_id))
{
int id;
}
int
-main(int argc, char **argv)
+main()
{
/* TODO:
* - Add file monitor on files, so that we catch changes on files
static char *cache_file = NULL;
static Eet_File *cache = NULL;
-static Eet_Data_Descriptor *edd = NULL;
+static Eet_Data_Descriptor *desktop_edd = NULL;
#ifdef EFREET_MODULE_LOG_DOM
#undef EFREET_MODULE_LOG_DOM
}
if (!ecore_file_init())
goto ecore_error;
- edd = efreet_desktop_edd_init();
- if (!edd)
+ desktop_edd = efreet_desktop_edd_init();
+ if (!desktop_edd)
goto edd_error;
efreet_desktop_cache = eina_hash_string_superfast_new(NULL);
efreet_desktop_types);
}
if (cache) eet_close(cache);
- efreet_desktop_edd_shutdown(edd);
+ efreet_desktop_edd_shutdown(desktop_edd);
ecore_file_shutdown();
eina_log_domain_unregister(_efreet_desktop_log_dom);
IF_FREE(cache_file);
if (cache)
{
/* TODO: Check if the cached version is out of date */
- desktop = eet_data_read(cache, edd, file);
+ desktop = eet_data_read(cache, desktop_edd, file);
if (desktop)
{
desktop->ref = 1;
}
else
{
- char *abs = efreet_desktop_command_path_absolute(file);
+ char *absol = efreet_desktop_command_path_absolute(file);
/* process local uri/path */
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH)
- f->fullpath = strdup(abs);
+ f->fullpath = strdup(absol);
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
{
char buf[PATH_MAX];
- snprintf(buf, sizeof(buf), "file://%s", abs);
+ snprintf(buf, sizeof(buf), "file://%s", absol);
f->uri = strdup(buf);
}
path = efreet_icon_path_find(theme_name, icon, size);
if (path)
{
- Efreet_Icon *icon;
+ Efreet_Icon *ic;
- icon = efreet_icon_new(path);
+ ic = efreet_icon_new(path);
free(path);
- return icon;
+ return ic;
}
return NULL;
{
Efreet_Xml *merge_xml;
Efreet_Menu_Internal *internal;
- char *realpath;
+ char *rp;
if (!parent || !xml || !path) return 0;
/* do nothing if the file doesn't exist */
if (!ecore_file_exists(path)) return 1;
- realpath = ecore_file_realpath(path);
- if (realpath[0] == '\0')
+ rp = ecore_file_realpath(path);
+ if (rp[0] == '\0')
{
INF("efreet_menu_merge() unable to get real path for %s", path);
return 0;
}
/* don't merge the same path twice */
- if (eina_hash_find(efreet_merged_menus, realpath))
+ if (eina_hash_find(efreet_merged_menus, rp))
{
- FREE(realpath);
+ FREE(rp);
return 1;
}
- eina_hash_add(efreet_merged_menus, realpath, (void *)1);
+ eina_hash_add(efreet_merged_menus, rp, (void *)1);
- merge_xml = efreet_xml_new(realpath);
+ merge_xml = efreet_xml_new(rp);
if (!merge_xml)
{
INF("efreet_menu_merge() failed to read in the "
- "merge file (%s)", realpath);
- FREE(realpath);
+ "merge file (%s)", rp);
+ FREE(rp);
return 0;
}
- FREE(realpath);
+ FREE(rp);
internal = efreet_menu_internal_new();
efreet_menu_path_set(internal, path);
* be done once per menu.*/
if (eina_list_count(internal->applications))
{
- Efreet_Menu_Desktop *md;
- Eina_List *l, *l2;
+ Eina_List *l2;
EINA_LIST_FOREACH_SAFE(internal->applications, l, l2, md)
{
if (eina_list_count(themes) > 0)
{
- char *dir;
-
printf("efreet_icon_theme_list_get() missed: ");
EINA_LIST_FOREACH(themes, l, dir)
printf("%s ", dir);
}
}
-const char *icons[] =
+const char *system_icons[] =
{
"address-book-new",
"application-exit",
themes = eina_list_remove_list(themes, themes);
double start = ecore_time_get();
- for (i = 0; icons[i] != NULL; i++)
+ for (i = 0; system_icons[i] != NULL; i++)
{
char *path, *s;
- path = efreet_icon_path_find(THEME, icons[i], SIZE);
+ path = efreet_icon_path_find(THEME, system_icons[i], SIZE);
if (!path)
{
#if 1
- if (eina_hash_find(icon_hash, icons[i]))
+ if (eina_hash_find(icon_hash, system_icons[i]))
{
- printf("NOT FOUND %s\n", icons[i]);
+ printf("NOT FOUND %s\n", system_icons[i]);
ret = 0;
}
#endif
continue;
}
- else if (!eina_hash_find(icon_hash, icons[i]))
+ else if (!eina_hash_find(icon_hash, system_icons[i]))
{
- printf("Found icon not in hash: %s\n", icons[i]);
+ printf("Found icon not in hash: %s\n", system_icons[i]);
}
s = strrchr(path, '.');
s = strrchr(path, '/');
if (s) s++;
- if (s && strcmp(s, icons[i]))
+ if (s && strcmp(s, system_icons[i]))
{
- printf("Name mismatch name (%s) vs ef (%s)\n", icons[i], s);
+ printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s);
ret = 0;
}
free(path);
eina_hash_free(icon_hash);
start = ecore_time_get();
- for (i = 0; icons[i] != NULL; i++)
+ for (i = 0; system_icons[i] != NULL; i++)
{
char *path, *s;
- path = efreet_icon_path_find(THEME, icons[i], SIZE);
+ path = efreet_icon_path_find(THEME, system_icons[i], SIZE);
if (!path) continue;
s = strrchr(path, '/');
if (s) s++;
- if (s && strcmp(s, icons[i]))
+ if (s && strcmp(s, system_icons[i]))
{
- printf("Name mismatch name (%s) vs ef (%s)\n", icons[i], s);
+ printf("Name mismatch name (%s) vs ef (%s)\n", system_icons[i], s);
ret = 0;
}
free(path);