[gtk+] app-chooser-button: make sure to always get a valid iter



commit 9ffd1f7adbda3866d7fe0acaefb5eca8f684724e
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Dec 1 16:29:57 2010 +0100

    app-chooser-button: make sure to always get a valid iter
    
    Even in case there are no installed applications for our content type.

 gtk/gtkappchooserbutton.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkappchooserbutton.c b/gtk/gtkappchooserbutton.c
index 639520c..b510764 100644
--- a/gtk/gtkappchooserbutton.c
+++ b/gtk/gtkappchooserbutton.c
@@ -262,6 +262,8 @@ gtk_app_chooser_button_populate (GtkAppChooserButton *self)
   recommended_apps = g_app_info_get_recommended_for_type (self->priv->content_type);
   first = TRUE;
 
+  get_first_iter (self->priv->store, &iter);
+
   for (l = recommended_apps; l != NULL; l = l->next)
     {
       app = l->data;
@@ -275,7 +277,6 @@ gtk_app_chooser_button_populate (GtkAppChooserButton *self)
 
       if (first)
         {
-          get_first_iter (self->priv->store, &iter);
           first = FALSE;
         }
       else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]