diff options
author | Sushma Rai <rsushma@src.gnome.org> | 2006-02-27 14:54:16 +0800 |
---|---|---|
committer | Sushma Rai <rsushma@src.gnome.org> | 2006-02-27 14:54:16 +0800 |
commit | 02f4fc54372fa72cfbbd59344be31800472fce2e (patch) | |
tree | 17b712e4c80f5c98ca89dc0be4657b6b1404a4fb /plugins/exchange-operations/exchange-folder-permission.c | |
parent | 9e4a5e053f2e3686d7a2eccf61d1c9cac296595a (diff) | |
download | gsoc2013-evolution-02f4fc54372fa72cfbbd59344be31800472fce2e.tar.gz gsoc2013-evolution-02f4fc54372fa72cfbbd59344be31800472fce2e.tar.zst gsoc2013-evolution-02f4fc54372fa72cfbbd59344be31800472fce2e.zip |
Trying to get the exchange account, only when invoked for exchange account
and also not showing the folder permissions dialog when invoked in offline
mode. See #332514.
svn path=/trunk/; revision=31585
Diffstat (limited to 'plugins/exchange-operations/exchange-folder-permission.c')
-rw-r--r-- | plugins/exchange-operations/exchange-folder-permission.c | 86 |
1 files changed, 53 insertions, 33 deletions
diff --git a/plugins/exchange-operations/exchange-folder-permission.c b/plugins/exchange-operations/exchange-folder-permission.c index 8a33d55f22..8760cf8d79 100644 --- a/plugins/exchange-operations/exchange-folder-permission.c +++ b/plugins/exchange-operations/exchange-folder-permission.c @@ -68,24 +68,24 @@ void org_gnome_exchange_calendar_permissions (EPlugin *ep, ECalPopupTargetSource *target) { GSList *menus = NULL; - int i = 0; + int i = 0, mode; static int first =0; ExchangeAccount *account = NULL; ESource *source = NULL; gchar *uri = NULL; - account = exchange_operations_get_exchange_account (); - - if (!account) - return; - source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); uri = (gchar *) e_source_get_uri (source); - if (uri && ! g_strrstr (uri, "exchange://")) { return; } + account = exchange_operations_get_exchange_account (); + if (!account) + return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) + return; if (!exchange_account_get_folder (account, uri)) return; @@ -109,23 +109,24 @@ void org_gnome_exchange_addressbook_permissions (EPlugin *ep, EABPopupTargetSource *target) { GSList *menus = NULL; - int i = 0; + int i = 0, mode; static int first =0; ExchangeAccount *account = NULL; ESource *source = NULL; gchar *uri = NULL; - account = exchange_operations_get_exchange_account (); - - if (!account) - return; - source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector)); uri = (gchar *) e_source_get_uri (source); - if (!g_strrstr (uri, "exchange://")) return; + account = exchange_operations_get_exchange_account (); + if (!account) + return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) + return; + if (!exchange_account_get_folder (account, uri)) return; @@ -147,7 +148,7 @@ void org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *target) { GSList *menus = NULL; - int i = 0; + int i = 0, mode; static int first =0; gchar *path = NULL; ExchangeAccount *account = NULL; @@ -156,7 +157,10 @@ org_gnome_exchange_folder_permissions (EPlugin *ep, EMPopupTargetFolder *target) return; account = exchange_operations_get_exchange_account (); - if (!account) + if (!account ) + return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) return; path = target->uri + strlen ("exchange://") + strlen (account->account_filename); @@ -201,11 +205,17 @@ org_gnome_exchange_menu_folder_permissions (EPlugin *ep, EMMenuTargetSelect *tar ExchangeAccount *account = NULL; EFolder *folder = NULL; gchar *path = NULL; + int mode; - account = exchange_operations_get_exchange_account (); + if (!g_str_has_prefix (target->uri, "exchange://")) + return; + account = exchange_operations_get_exchange_account (); if (!account) return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) + return; path = target->uri + strlen ("exchange://") + strlen (account->account_filename); folder = exchange_account_get_folder (account, path); @@ -221,24 +231,28 @@ org_gnome_exchange_menu_cal_permissions (EPlugin *ep, ECalMenuTargetSelect *targ ECalModel *model = NULL; ECal *ecal = NULL; gchar *uri = NULL; + int mode; - account = exchange_operations_get_exchange_account (); - - if (!account || !target) + if (!target) return; - if (target->model) model = E_CAL_MODEL (target->model); ecal = e_cal_model_get_default_client (model); uri = (gchar *) e_cal_get_uri (ecal); - if (!uri) return; else if (!g_str_has_prefix (uri, "exchange://")) return; + account = exchange_operations_get_exchange_account (); + if (!account) + return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) + return; + folder = exchange_account_get_folder (account, uri); exchange_permissions_dialog_new (account, folder, NULL); } @@ -251,27 +265,29 @@ org_gnome_exchange_menu_tasks_permissions (EPlugin *ep, ECalMenuTargetSelect *ta ECalModel *model = NULL; ECal *ecal = NULL; gchar *uri = NULL; + int mode; - account = exchange_operations_get_exchange_account (); - - if (!account || !target) + if (!target) return; - if (target->model) model = E_CAL_MODEL (target->model); ecal = e_cal_model_get_default_client (model); uri = (gchar *) e_cal_get_uri (ecal); - if (!uri) return; else if (!g_str_has_prefix (uri, "exchange://")) return; + account = exchange_operations_get_exchange_account (); + if (!account) + return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) + return; folder = exchange_account_get_folder (account, uri); exchange_permissions_dialog_new (account, folder, NULL); - } void @@ -281,23 +297,27 @@ org_gnome_exchange_menu_ab_permissions (EPlugin *ep, EABMenuTargetSelect *target EFolder *folder = NULL; EBook *ebook = NULL; gchar *uri = NULL; + int mode; - account = exchange_operations_get_exchange_account (); - - if (!target || !account) + if (!target) return; - if (target->book) ebook = E_BOOK (target->book); uri = (gchar *) e_book_get_uri (ebook); - if (!uri) return; else if (!g_str_has_prefix (uri, "exchange://")) return; + account = exchange_operations_get_exchange_account (); + if (!account) + return; + exchange_account_is_offline (account, &mode); + if (mode == OFFLINE_MODE) + return; + folder = exchange_account_get_folder (account, uri); exchange_permissions_dialog_new (account, folder, NULL); } |