Beginning with glib >= 2.41, g_app_info_get_all_for_type() no longer
puts the default application in front of the list.

So now we have to use g_app_info_get_default_for_type().
---
 src/gtk/fm-app-chooser-combo-box.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gtk/fm-app-chooser-combo-box.c 
b/src/gtk/fm-app-chooser-combo-box.c
index a9d544e..f8c5cb9 100644
--- a/src/gtk/fm-app-chooser-combo-box.c
+++ b/src/gtk/fm-app-chooser-combo-box.c
@@ -179,8 +179,7 @@ void fm_app_chooser_combo_box_setup(GtkComboBox* combo, 
FmMimeType* mime_type, G
     {
         data->mime_type = fm_mime_type_ref(mime_type);
         apps = 
g_app_info_get_all_for_type(fm_mime_type_get_type(data->mime_type));
-        if(apps)
-            sel = G_APP_INFO(apps->data); /* default app is the first one in 
the list. */
+        sel =  
g_app_info_get_default_for_type(fm_mime_type_get_type(data->mime_type), FALSE);
     }
 
     for(l = apps; l; l = l->next)
@@ -205,6 +204,8 @@ void fm_app_chooser_combo_box_setup(GtkComboBox* combo, 
FmMimeType* mime_type, G
             g_list_foreach(apps, (GFunc)g_object_unref, NULL);
             g_list_free(apps);
         }
+        if(sel)
+            g_object_unref(sel);
     }
 
     gtk_list_store_append(store, &it); /* separator */
-- 
2.1.2


------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Pcmanfm-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pcmanfm-develop

Reply via email to