aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibha Yadav <yvibha@suse.com>2012-03-29 14:45:06 +0800
committerVibha Yadav <yvibha@suse.com>2012-03-29 14:45:06 +0800
commit954b3f1cc496f469ce0472db87caafccbfa947da (patch)
tree3047d85f272254b41ffd02536aa565a3bc0964a2
parentafb3db076d573e52d634c7d5e2d40d8da9785941 (diff)
downloadgsoc2013-evolution-954b3f1cc496f469ce0472db87caafccbfa947da.tar.gz
gsoc2013-evolution-954b3f1cc496f469ce0472db87caafccbfa947da.tar.zst
gsoc2013-evolution-954b3f1cc496f469ce0472db87caafccbfa947da.zip
Bug #670445 - Folder deletion in offline shows strange behavior
Providing a check for online backend before proceeding for the operation.
-rw-r--r--mail/e-mail-reader-utils.c12
-rw-r--r--mail/mail.error.xml5
2 files changed, 17 insertions, 0 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c
index 5956ab209d..54c588b9c9 100644
--- a/mail/e-mail-reader-utils.c
+++ b/mail/e-mail-reader-utils.c
@@ -195,6 +195,7 @@ e_mail_reader_delete_folder (EMailReader *reader,
{
EMailBackend *backend;
EMailSession *session;
+ EShell *shell;
EAlertSink *alert_sink;
CamelStore *parent_store;
MailFolderCache *folder_cache;
@@ -231,6 +232,17 @@ e_mail_reader_delete_folder (EMailReader *reader,
return;
}
+ shell = e_shell_backend_get_shell (E_SHELL_BACKEND (backend));
+
+ if(!store_is_local && !e_shell_get_online (shell))
+ {
+ e_alert_submit (
+ alert_sink, "mail:online-operation",
+ display_name, NULL);
+ return;
+ }
+
+
have_flags = mail_folder_cache_get_folder_info_flags (
folder_cache, folder, &flags);
diff --git a/mail/mail.error.xml b/mail/mail.error.xml
index b5a714ff18..3a9dab56bf 100644
--- a/mail/mail.error.xml
+++ b/mail/mail.error.xml
@@ -525,5 +525,10 @@ An mbox account will be created to preserve the old mbox folders. You can delete
<_secondary>The printer replied &quot;{0}&quot;.</_secondary>
</error>
+ <error id="online-operation" type="error">
+ <_primary>Could not perform this operation on {0}.</_primary>
+ <_secondary xml:space="preserve">You must be working online to complete this operation.</_secondary>
+ </error>
+
</error-list>