aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2013-08-27 09:10:57 +0800
committerFabiano FidĂȘncio <fidencio@redhat.com>2013-08-29 15:36:55 +0800
commitb4870d386c9d7e449b19a3af4972229d52febec5 (patch)
treef5076b73ec51aa1c66153ce43f8e442a0bae20aa
parent233f925bfc15e6545a4a41684b86e05f15bea973 (diff)
downloadgsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.tar
gsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.tar.gz
gsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.tar.bz2
gsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.tar.lz
gsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.tar.xz
gsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.tar.zst
gsoc2013-evolution-b4870d386c9d7e449b19a3af4972229d52febec5.zip
Bug #706814 - Do not use folder uri in copy/move folder errors
-rw-r--r--mail/em-folder-tree.c14
-rw-r--r--mail/em-folder-utils.c18
2 files changed, 25 insertions, 7 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index e2aa6d5e37..bb8dc0475b 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1967,9 +1967,11 @@ ask_drop_folder (EMFolderTree *folder_tree,
gboolean is_move)
{
const gchar *key = is_move ? "prompt-on-folder-drop-move" : "prompt-on-folder-drop-copy";
+ const gchar *src_display_name, *des_display_name;
EMailSession *session;
GSettings *settings;
gchar *set_value, *src_folder_name = NULL;
+ gchar *src_folder = NULL, *des_folder = NULL;
CamelProvider *src_provider, *des_provider;
CamelStore *src_store = NULL;
GError *error = NULL;
@@ -2019,9 +2021,13 @@ ask_drop_folder (EMFolderTree *folder_tree,
src_provider = camel_service_get_provider (CAMEL_SERVICE (src_store));
src_store_is_local = (src_provider->flags & CAMEL_PROVIDER_IS_LOCAL) != 0;
+ src_display_name = camel_service_get_display_name (CAMEL_SERVICE (src_store));
+ src_folder = g_strdup_printf ("%s: %s", src_display_name, src_folder_name);
des_provider = camel_service_get_provider (CAMEL_SERVICE (des_store));
des_store_is_local = (des_provider->flags & CAMEL_PROVIDER_IS_LOCAL) != 0;
+ des_display_name = camel_service_get_display_name (CAMEL_SERVICE (des_store));
+ des_folder = g_strdup_printf ("%s: %s", des_display_name, des_full_name);
if (!session_is_online && (!src_store_is_local || !des_store_is_local)) {
EAlertSink *alert_sink;
@@ -2030,9 +2036,11 @@ ask_drop_folder (EMFolderTree *folder_tree,
e_alert_submit (
alert_sink,
"mail:online-operation",
- src_store_is_local ? des_full_name : src_folder_name,
+ src_store_is_local ? des_folder : src_folder,
NULL);
g_free (src_folder_name);
+ g_free (src_folder);
+ g_free (des_folder);
g_object_unref (src_store);
g_object_unref (settings);
@@ -2048,7 +2056,7 @@ ask_drop_folder (EMFolderTree *folder_tree,
parent,
is_move ? "mail:ask-folder-drop-move" : "mail:ask-folder-drop-copy",
src_folder_name,
- des_full_name && *des_full_name ? des_full_name :
+ des_full_name && *des_full_name ? des_folder :
camel_service_get_display_name (CAMEL_SERVICE (des_store)),
NULL);
response = gtk_dialog_run (GTK_DIALOG (widget));
@@ -2060,6 +2068,8 @@ ask_drop_folder (EMFolderTree *folder_tree,
g_settings_set_string (settings, key, "never");
g_free (src_folder_name);
+ g_free (src_folder);
+ g_free (des_folder);
g_object_unref (src_store);
g_object_unref (settings);
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 8302cebef7..4181a41981 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -343,7 +343,9 @@ emfu_copy_folder_selected (EMailSession *session,
CamelStore *tostore = NULL;
CamelService *service, *toservice;
gboolean store_is_local, tostore_is_local, session_is_online;
+ const gchar *display_name, *todisplay_name;
gchar *tobase = NULL;
+ gchar *folder_name = NULL, *tofolder_name = NULL;
GError *local_error = NULL;
if (uri == NULL)
@@ -354,6 +356,8 @@ emfu_copy_folder_selected (EMailSession *session,
service = CAMEL_SERVICE (cfd->source_store);
provider = camel_service_get_provider (service);
store_is_local = (provider->flags & CAMEL_PROVIDER_IS_LOCAL) != 0;
+ display_name = camel_service_get_display_name (service);
+ folder_name = g_strdup_printf ("%s: %s", display_name, cfd->source_folder_name);
e_mail_folder_uri_parse (
CAMEL_SESSION (session), uri,
@@ -364,7 +368,7 @@ emfu_copy_folder_selected (EMailSession *session,
alert_sink, cfd->delete ?
"mail:no-move-folder-to-nostore" :
"mail:no-copy-folder-to-nostore",
- cfd->source_folder_name, uri,
+ folder_name, uri,
local_error->message, NULL);
goto fail;
}
@@ -374,12 +378,14 @@ emfu_copy_folder_selected (EMailSession *session,
toservice = CAMEL_SERVICE (tostore);
toprovider = camel_service_get_provider (toservice);
tostore_is_local = (toprovider->flags & CAMEL_PROVIDER_IS_LOCAL) != 0;
+ todisplay_name = camel_service_get_display_name (toservice);
+ tofolder_name = g_strdup_printf ("%s: %s", todisplay_name, tobase);
if (!session_is_online && (!store_is_local || !tostore_is_local)) {
e_alert_submit (
alert_sink,
"mail:online-operation",
- store_is_local ? uri : cfd->source_folder_name,
+ store_is_local ? tofolder_name : folder_name,
NULL);
goto fail;
}
@@ -390,7 +396,7 @@ emfu_copy_folder_selected (EMailSession *session,
alert_sink, cfd->delete ?
"mail:no-move-folder-nostore" :
"mail:no-copy-folder-nostore",
- cfd->source_folder_name, uri,
+ folder_name, tofolder_name,
local_error->message, NULL);
goto fail;
}
@@ -400,7 +406,7 @@ emfu_copy_folder_selected (EMailSession *session,
e_alert_submit (
alert_sink,
"mail:no-rename-special-folder",
- cfd->source_folder_name, NULL);
+ folder_name, NULL);
goto fail;
}
@@ -410,7 +416,7 @@ emfu_copy_folder_selected (EMailSession *session,
alert_sink, cfd->delete ?
"mail:no-move-folder-to-nostore" :
"mail:no-copy-folder-to-nostore",
- cfd->source_folder_name, uri,
+ folder_name, tofolder_name,
local_error->message, NULL);
goto fail;
}
@@ -431,6 +437,8 @@ fail:
if (tostore)
g_object_unref (tostore);
g_free (tobase);
+ g_free (folder_name);
+ g_free (tofolder_name);
}
/* tree here is the 'destination' selector, not 'self' */