Make new folder dialog for hildon2.2 assume current account as parent
authorJose Dapena Paz <jdapena@igalia.com>
Mon, 22 Dec 2008 11:33:39 +0000 (11:33 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Mon, 22 Dec 2008 11:33:39 +0000 (11:33 +0000)
pmo-trunk-r6969

src/modest-ui-actions.c

index a1012d4..5441075 100644 (file)
@@ -3316,7 +3316,19 @@ modest_ui_actions_create_folder(GtkWidget *parent_window,
 {
        TnyFolderStore *parent_folder;
 
+#ifdef MODEST_TOOLKIT_HILDON2
+       const gchar *active_account;
+       TnyAccount *account;
+
+       /* In hildon 2.2 we use the current account as default parent */
+       active_account = modest_window_get_active_account (MODEST_WINDOW (parent_window));
+       account = modest_tny_account_store_get_server_account (modest_runtime_get_account_store (),
+                                                              active_account,
+                                                              TNY_ACCOUNT_TYPE_STORE);
+       parent_folder = TNY_FOLDER_STORE (account);
+#else
        parent_folder = modest_folder_view_get_selected (MODEST_FOLDER_VIEW(folder_view));
+#endif
        
        if (parent_folder) {
                /* The parent folder will be freed in the callback */
@@ -3326,6 +3338,9 @@ modest_ui_actions_create_folder(GtkWidget *parent_window,
                                                               create_folder_performer, 
                                                               parent_folder);
        }
+#ifdef MODEST_TOOLKIT_HILDON2
+       g_object_unref (parent_folder);
+#endif
 }
 
 void