[evolution/wip/gsettings] em_folder_utils_create_folder(): Change function parameters.
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/gsettings] em_folder_utils_create_folder(): Change function parameters.
- Date: Wed, 29 Jun 2011 17:37:23 +0000 (UTC)
commit 7aa164895ce4e4ba760af1415e45d7b264d2d2c3
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri May 6 12:34:33 2011 -0400
em_folder_utils_create_folder(): Change function parameters.
Take a folder URI string instead of a CamelFolderInfo, and swap places
with the GtkWindow parameter.
mail/em-folder-selector.c | 4 +++-
mail/em-folder-utils.c | 16 ++++++++++------
mail/em-folder-utils.h | 4 ++--
modules/mail/e-mail-shell-backend.c | 2 +-
modules/mail/e-mail-shell-view-actions.c | 12 ++++++------
5 files changed, 22 insertions(+), 16 deletions(-)
---
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index ae3092d..5bf3b3f 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -116,7 +116,9 @@ emfs_response (GtkWidget *dialog, gint response, EMFolderSelector *emfs)
g_object_set_data ((GObject *)emfs->emft, "select", GUINT_TO_POINTER (1));
- em_folder_utils_create_folder (NULL, emfs->emft, em_folder_tree_get_session (emfs->emft), GTK_WINDOW (dialog));
+ em_folder_utils_create_folder (
+ GTK_WINDOW (dialog), emfs->emft,
+ em_folder_tree_get_session (emfs->emft), NULL);
g_signal_stop_emission_by_name (emfs, "response");
}
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index fdf18c2..182ec20 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -773,10 +773,10 @@ emfu_popup_new_folder_response (EMFolderSelector *emfs,
/* FIXME: these functions must be documented */
void
-em_folder_utils_create_folder (CamelFolderInfo *folderinfo,
+em_folder_utils_create_folder (GtkWindow *parent,
EMFolderTree *emft,
- EMailSession *session,
- GtkWindow *parent)
+ EMailSession *session,
+ const gchar *initial_uri)
{
EMFolderTree *folder_tree;
GtkWidget *dialog;
@@ -788,9 +788,13 @@ em_folder_utils_create_folder (CamelFolderInfo *folderinfo,
parent, folder_tree, 0,
_("Create Folder"),
_("Specify where to create the folder:"));
- if (folderinfo != NULL)
- em_folder_selector_set_selected ((EMFolderSelector *) dialog, folderinfo->uri);
- g_signal_connect (dialog, "response", G_CALLBACK (emfu_popup_new_folder_response), emft ? emft : folder_tree);
+ if (initial_uri != NULL)
+ em_folder_selector_set_selected (
+ EM_FOLDER_SELECTOR (dialog), initial_uri);
+ g_signal_connect (
+ dialog, "response",
+ G_CALLBACK (emfu_popup_new_folder_response),
+ emft ? emft : folder_tree);
if (!parent || !GTK_IS_DIALOG (parent))
gtk_widget_show (dialog);
diff --git a/mail/em-folder-utils.h b/mail/em-folder-utils.h
index 54ccf58..8f7a2c7 100644
--- a/mail/em-folder-utils.h
+++ b/mail/em-folder-utils.h
@@ -46,10 +46,10 @@ void em_folder_utils_copy_folder (GtkWindow *parent,
gboolean delete);
void em_folder_utils_delete_folder (EMailBackend *backend,
CamelFolder *folder);
-void em_folder_utils_create_folder (CamelFolderInfo *folderinfo,
+void em_folder_utils_create_folder (GtkWindow *parent,
EMFolderTree *emft,
EMailSession *session,
- GtkWindow *parent);
+ const gchar *initial_uri);
const gchar * em_folder_utils_get_icon_name (guint32 flags);
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index c29dbdc..180e5b2 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -140,7 +140,7 @@ action_mail_folder_new_cb (GtkAction *action,
exit:
em_folder_utils_create_folder (
- NULL, folder_tree, mail_session, GTK_WINDOW (shell_window));
+ GTK_WINDOW (shell_window), folder_tree, mail_session, NULL);
}
static void
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index a2b6f18..f311246 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -385,23 +385,23 @@ action_mail_folder_new_cb (GtkAction *action,
EShellWindow *shell_window;
EMailSession *session;
EMailShellSidebar *mail_shell_sidebar;
- CamelFolderInfo *folder_info;
EMFolderTree *folder_tree;
+ gchar *selected_uri;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
- folder_info = em_folder_tree_get_selected_folder_info (folder_tree);
+
session = em_folder_tree_get_session (folder_tree);
- g_return_if_fail (folder_info != NULL);
+ selected_uri = em_folder_tree_get_selected_uri (folder_tree);
em_folder_utils_create_folder (
- folder_info, folder_tree, session,
- GTK_WINDOW (shell_window));
+ GTK_WINDOW (shell_window),
+ folder_tree, session, selected_uri);
- camel_folder_info_free (folder_info);
+ g_free (selected_uri);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]