Fixes NB#124248, new folders dialog shows all the accounts
authorSergio Villar Senin <svillar@igalia.com>
Tue, 23 Jun 2009 15:40:22 +0000 (17:40 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 23 Jun 2009 15:40:51 +0000 (17:40 +0200)
src/hildon2/modest-platform.c

index de893c7..516a72a 100644 (file)
@@ -947,6 +947,7 @@ static GtkWidget *
 folder_picker_new (TnyFolderStore *suggested, FolderPickerHelper *helper)
 {
        GtkWidget *button;
 folder_picker_new (TnyFolderStore *suggested, FolderPickerHelper *helper)
 {
        GtkWidget *button;
+       const gchar *acc_id = NULL;
 
        button = hildon_button_new (MODEST_EDITABLE_SIZE,
                                    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
 
        button = hildon_button_new (MODEST_EDITABLE_SIZE,
                                    HILDON_BUTTON_ARRANGEMENT_HORIZONTAL);
@@ -954,7 +955,6 @@ folder_picker_new (TnyFolderStore *suggested, FolderPickerHelper *helper)
        hildon_button_set_alignment (HILDON_BUTTON (button), 0.0, 0.5, 1.0, 1.0);
 
        if (suggested) {
        hildon_button_set_alignment (HILDON_BUTTON (button), 0.0, 0.5, 1.0, 1.0);
 
        if (suggested) {
-               const gchar *acc_id = NULL;
 
                folder_picker_set_store (GTK_BUTTON (button), suggested);
 
 
                folder_picker_set_store (GTK_BUTTON (button), suggested);
 
@@ -969,13 +969,14 @@ folder_picker_new (TnyFolderStore *suggested, FolderPickerHelper *helper)
                                g_object_unref (account);
                        }
                }
                                g_object_unref (account);
                        }
                }
+       }
 
 
-               if (!acc_id)
-                       modest_folder_view_get_account_id_of_visible_server_account (MODEST_FOLDER_VIEW(helper->folder_view));
+       if (!acc_id)
+               acc_id = modest_folder_view_get_account_id_of_visible_server_account (MODEST_FOLDER_VIEW(helper->folder_view));
+
+       g_object_set_data_full (G_OBJECT (button), FOLDER_PICKER_ORIGINAL_ACCOUNT,
+                               g_strdup (acc_id), (GDestroyNotify) g_free);
 
 
-               g_object_set_data_full (G_OBJECT (button), FOLDER_PICKER_ORIGINAL_ACCOUNT,
-                                       g_strdup (acc_id), (GDestroyNotify) g_free);
-       }
 
        g_signal_connect (G_OBJECT (button), "clicked",
                          G_CALLBACK (folder_picker_clicked),
 
        g_signal_connect (G_OBJECT (button), "clicked",
                          G_CALLBACK (folder_picker_clicked),