diff options
author | Vivek Jain <jvivek@novell.com> | 2005-03-10 17:19:48 +0800 |
---|---|---|
committer | Jain Vivek <jvivek@src.gnome.org> | 2005-03-10 17:19:48 +0800 |
commit | fbff4ba71e46ad645f30aba637f17519ded42895 (patch) | |
tree | f664ae71edb1c0736dd0981cd9b85044f8b72944 /plugins | |
parent | 5f536963ba0f268a0bec572da6d3a8e5b43e3779 (diff) | |
download | gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.tar gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.tar.gz gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.tar.bz2 gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.tar.lz gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.tar.xz gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.tar.zst gsoc2013-evolution-fbff4ba71e46ad645f30aba637f17519ded42895.zip |
**Fixes #73201 use full_name given by CamelFolder to get the selected
2005-03-10 Vivek Jain <jvivek@novell.com>
**Fixes #73201
* share-folder-common.c : (org_gnome_shared_folder_factory)
use full_name given by CamelFolder to get the selected folder name
svn path=/trunk/; revision=28993
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/shared-folder/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/shared-folder/share-folder-common.c | 29 |
2 files changed, 22 insertions, 13 deletions
diff --git a/plugins/shared-folder/ChangeLog b/plugins/shared-folder/ChangeLog index 8beb6aa61b..49b341606f 100644 --- a/plugins/shared-folder/ChangeLog +++ b/plugins/shared-folder/ChangeLog @@ -1,3 +1,9 @@ +2005-03-10 Vivek Jain <jvivek@novell.com> + + **Fixes #73201 + * share-folder-common.c : (org_gnome_shared_folder_factory) + use full_name given by CamelFolder to get the selected folder name + 2005-02-24 Björn Torkelsson <torkel@acc.umu.se> * org-gnome-shared-folder.eplug.in: Added Groupwise to name. diff --git a/plugins/shared-folder/share-folder-common.c b/plugins/shared-folder/share-folder-common.c index 45996caae6..fe749e6c8f 100644 --- a/plugins/shared-folder/share-folder-common.c +++ b/plugins/shared-folder/share-folder-common.c @@ -360,23 +360,26 @@ org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_d gchar *account = NULL; gchar *id = NULL; gchar *sub = NULL; + gchar *folder_name = NULL; EGwConnection *cnc; ShareFolder *sharing_tab; EMConfigTargetFolder *target= (EMConfigTargetFolder *)hook_data->config->target; - + CamelFolder *folder = target->folder; + + folder_name = g_strdup (folder->full_name); folderuri = g_strdup(target->uri); - if (folderuri) { + if (folderuri && folder_name) account = g_strrstr(folderuri, "groupwise"); - sub = g_strrstr(folderuri, "#"); - } else + else return NULL; - - if(sub == NULL) - sub = g_strrstr(folderuri, "/"); + + sub = g_strrstr (folder_name, "/"); if (sub) sub++; else - return NULL; + sub = folder_name; + + /* This is kind of bad..but we don't have types for all these folders.*/ if ( !( strcmp (sub, "Mailbox") && strcmp (sub, "Calendar") && strcmp (sub, "Contacts") && strcmp (sub, "Documents") && strcmp (sub, "Authored") && strcmp (sub, "Default Library") && strcmp (sub, "Work In Progress") && strcmp (sub, "Cabinet") && strcmp (sub, "Sent Items") && strcmp (sub, "Trash") && strcmp (sub, "Checklist"))) { g_free (folderuri); @@ -384,23 +387,22 @@ org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_d } if (account) { - CamelFolder *folder = target->folder; CamelStore *store = folder->parent_store; cnc = get_cnc (store); + if (E_IS_GW_CONNECTION (cnc)) id = get_container_id (cnc, sub); else g_warning("Could not Connnect\n"); - g_free (folderuri); if (cnc && id) sharing_tab = share_folder_new (cnc, id); else return NULL; - + gtk_notebook_append_page((GtkNotebook *) hook_data->parent, (GtkWidget *) sharing_tab->vbox, gtk_label_new_with_mnemonic N_("Sharing")); common = sharing_tab; - + g_free (folderuri); return GTK_WIDGET (sharing_tab); } else return NULL; @@ -460,7 +462,7 @@ get_container_id(EGwConnection *cnc, gchar *fname) GList *container = NULL; for (container = container_list; container != NULL; container = container->next) { - name = e_gw_container_get_name (container->data); + name = g_strdup (e_gw_container_get_name (container->data)); /* if Null is passed as name then we return top lavel id*/ if (fname == NULL) { id = g_strdup (e_gw_container_get_id (container->data)); @@ -469,6 +471,7 @@ get_container_id(EGwConnection *cnc, gchar *fname) id = g_strdup (e_gw_container_get_id (container->data)); break; } + g_free (name); } e_gw_connection_free_container_list (container_list); } |