aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-properties.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-12-09 23:34:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-12-11 10:34:19 +0800
commit7c0c40f83317228e0a725bfb5ca8854339d25588 (patch)
treedb1197dd9f336e175c590c3a41201dfa78ee303e /mail/em-folder-properties.c
parent2f32e1cc68cd416f4530ecc3d2ff08b0e6498d45 (diff)
downloadgsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.tar
gsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.tar.gz
gsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.tar.bz2
gsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.tar.lz
gsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.tar.xz
gsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.tar.zst
gsoc2013-evolution-7c0c40f83317228e0a725bfb5ca8854339d25588.zip
Reorder accounts by drag-and-drop.
This implements https://bugzilla.gnome.org/show_bug.cgi?id=663527#c3. Account reordering is now done by drag-and-drop instead of up/down buttons. Turned out to be a wee bit more complicated than I initially thought. This scraps EAccountManager and EAccountTreeView and replaces them with new classes centered around EMailAccountStore, which EMailSession owns. EMailAccountStore is the model behind the account list in Preferences. The folder tree model now uses it to sort its own top-level rows using gtk_tree_path_compare(). It also broadcasts account operations through signals so we don't have to rely so heavily on EAccountList signals, since EAccountList is going away soon. Also as part of this work, the e-mail-local.h and e-mail-store.h APIs have been merged into EMailSession and MailFolderCache.
Diffstat (limited to 'mail/em-folder-properties.c')
-rw-r--r--mail/em-folder-properties.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index 310aa76740..9dbffba2e2 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -34,7 +34,6 @@
#include "e-mail-backend.h"
#include "e-mail-folder-utils.h"
-#include "e-mail-local.h"
#include "mail-ops.h"
#include "mail-mt.h"
#include "mail-vfolder.h"
@@ -249,25 +248,26 @@ emfp_dialog_run (AsyncContext *context)
EMConfigTargetFolder *target;
EShellWindow *shell_window;
EShellView *shell_view;
- CamelStore *local_store;
CamelStore *parent_store;
+ CamelFolderSummary *summary;
+ gboolean store_is_local;
gboolean hide_deleted;
GSettings *settings;
const gchar *name;
+ const gchar *uid;
shell_view = context->shell_view;
shell_window = e_shell_view_get_shell_window (shell_view);
- local_store = e_mail_local_get_store ();
parent_store = camel_folder_get_parent_store (context->folder);
/* Get number of VISIBLE and DELETED messages, instead of TOTAL
* messages. VISIBLE+DELETED gives the correct count that matches
* the label below the Send & Receive button. */
- name = camel_folder_get_display_name (context->folder);
- context->total = camel_folder_summary_get_visible_count (context->folder->summary);
- context->unread = camel_folder_summary_get_unread_count (context->folder->summary);
- deleted = camel_folder_summary_get_deleted_count (context->folder->summary);
+ summary = context->folder->summary;
+ context->total = camel_folder_summary_get_visible_count (summary);
+ context->unread = camel_folder_summary_get_unread_count (summary);
+ deleted = camel_folder_summary_get_deleted_count (summary);
settings = g_settings_new ("org.gnome.evolution.mail");
hide_deleted = !g_settings_get_boolean (settings, "show-deleted");
@@ -290,7 +290,12 @@ emfp_dialog_run (AsyncContext *context)
context->total = camel_folder_summary_count (
context->folder->summary);
- if (parent_store == local_store
+ name = camel_folder_get_display_name (context->folder);
+
+ uid = camel_service_get_uid (CAMEL_SERVICE (parent_store));
+ store_is_local = (g_strcmp0 (uid, E_MAIL_SESSION_LOCAL_UID) == 0);
+
+ if (store_is_local
&& (!strcmp (name, "Drafts")
|| !strcmp (name, "Templates")
|| !strcmp (name, "Inbox")
@@ -474,7 +479,7 @@ em_folder_properties_show (EShellView *shell_view,
/* Show the Edit Rule dialog for Search Folders, but not "Unmatched".
* "Unmatched" is a special Search Folder which can't be modified. */
- if (g_strcmp0 (uid, "vfolder") == 0) {
+ if (g_strcmp0 (uid, E_MAIL_SESSION_VFOLDER_UID) == 0) {
if (g_strcmp0 (folder_name, CAMEL_UNMATCHED_NAME) != 0) {
gchar *folder_uri;