Fix #897: Histogram not displayed until a refresh
[geeqie.git] / src / editors.c
index 192a0df..902e736 100644 (file)
@@ -104,7 +104,7 @@ void editor_description_free(EditorDescription *editor)
 
 static GList *editor_mime_types_to_extensions(gchar **mime_types)
 {
-       /* FIXME: this should be rewritten to use the shared mime database, as soon as we switch to gio */
+       /** @FIXME this should be rewritten to use the shared mime database, as soon as we switch to gio */
 
        static const gchar *conv_table[][2] = {
                {"application/x-ufraw", ".ufraw"},
@@ -113,6 +113,7 @@ static GList *editor_mime_types_to_extensions(gchar **mime_types)
                {"image/gif",           ".gif"},
                {"image/jpeg",          ".jpeg;.jpg;.mpo"},
                {"image/jpg",           ".jpg;.jpeg"},
+               {"image/webp",          ".webp"},
                {"image/pcx",           ".pcx"},
                {"image/png",           ".png"},
                {"image/svg",           ".svg"},
@@ -457,7 +458,7 @@ GList *editor_get_desktop_files(void)
        else
                xdg_data_dirs = g_strdup("/usr/share");
 
-       all_dirs = g_strconcat(get_rc_dir(), ":", GQ_APP_DIR, ":", xdg_data_home_get(), ":", xdg_data_dirs, NULL);
+       all_dirs = g_strconcat(get_rc_dir(), ":", gq_app_dir, ":", xdg_data_home_get(), ":", xdg_data_dirs, NULL);
 
        g_free(xdg_data_dirs);
 
@@ -501,12 +502,27 @@ static gint editor_sort(gconstpointer a, gconstpointer b)
 {
        const EditorDescription *ea = a;
        const EditorDescription *eb = b;
+       gchar *caseless_name_ea;
+       gchar *caseless_name_eb;
+       gchar *collate_key_ea;
+       gchar *collate_key_eb;
        gint ret;
 
        ret = strcmp(ea->menu_path, eb->menu_path);
        if (ret != 0) return ret;
 
-       return g_utf8_collate(ea->name, eb->name);
+       caseless_name_ea = g_utf8_casefold(ea->name, -1);
+       caseless_name_eb = g_utf8_casefold(eb->name, -1);
+       collate_key_ea = g_utf8_collate_key_for_filename(caseless_name_ea, -1);
+       collate_key_eb = g_utf8_collate_key_for_filename(caseless_name_eb, -1);
+       ret = g_strcmp0(collate_key_ea, collate_key_eb);
+
+       g_free(collate_key_ea);
+       g_free(collate_key_eb);
+       g_free(caseless_name_ea);
+       g_free(caseless_name_eb);
+
+       return ret;
 }
 
 GList *editor_list_get(void)
@@ -1068,7 +1084,7 @@ static EditorFlags editor_command_one(const EditorDescription *editor, GList *li
                args[n++] = command;
                args[n] = NULL;
 
-               if ((ed->flags & EDITOR_DEST) && fd && fd->change && fd->change->dest) /* FIXME: error handling */
+               if ((ed->flags & EDITOR_DEST) && fd && fd->change && fd->change->dest) /** @FIXME error handling */
                        {
                        g_setenv("GEEQIE_DESTINATION", fd->change->dest, TRUE);
                        }