comparison src/editors.c @ 1463:25168240a247

added function to reload external editors at any time eliminated init_after_global_options()
author nadvornik
date Fri, 20 Mar 2009 09:46:35 +0000
parents 863ac709f6b4
children e9f9d3da3f43
comparison
equal deleted inserted replaced
1462:75721f22155c 1463:25168240a247
165 type = g_key_file_get_string(key_file, DESKTOP_GROUP, "Type", NULL); 165 type = g_key_file_get_string(key_file, DESKTOP_GROUP, "Type", NULL);
166 if (!type || strcmp(type, "Application") != 0) 166 if (!type || strcmp(type, "Application") != 0)
167 { 167 {
168 /* We only consider desktop entries of Application type */ 168 /* We only consider desktop entries of Application type */
169 g_key_file_free(key_file); 169 g_key_file_free(key_file);
170 g_free(type);
170 return FALSE; 171 return FALSE;
171 } 172 }
173 g_free(type);
172 174
173 editor = g_new0(EditorDescription, 1); 175 editor = g_new0(EditorDescription, 1);
174 176
175 editor->key = g_strdup(key); 177 editor->key = g_strdup(key);
176 editor->file = g_strdup(path); 178 editor->file = g_strdup(path);
332 gchar *xdg_data_dirs; 334 gchar *xdg_data_dirs;
333 gchar *all_dirs; 335 gchar *all_dirs;
334 gchar **split_dirs; 336 gchar **split_dirs;
335 gint i; 337 gint i;
336 338
337 if (!editors) 339 if (editors)
338 { 340 {
339 editors = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)editor_description_free); 341 g_hash_table_destroy(editors);
340 } 342 }
343 editors = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)editor_description_free);
341 344
342 xdg_data_dirs = getenv("XDG_DATA_DIRS"); 345 xdg_data_dirs = getenv("XDG_DATA_DIRS");
343 if (xdg_data_dirs && xdg_data_dirs[0]) 346 if (xdg_data_dirs && xdg_data_dirs[0])
344 xdg_data_dirs = path_to_utf8(xdg_data_dirs); 347 xdg_data_dirs = path_to_utf8(xdg_data_dirs);
345 else 348 else