From: Sergio Villar Senin Date: Mon, 12 Jan 2009 10:48:54 +0000 (+0000) Subject: * Fixes NB#97149, MMC user created folders have a different icon X-Git-Tag: git_migration_finished~838 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=e39070411876953aea11f14cc0c2dcc309bbfd01 * Fixes NB#97149, MMC user created folders have a different icon pmo-trunk-r7097 --- diff --git a/src/gnome/modest-icon-names.h b/src/gnome/modest-icon-names.h index fc3530e..43172eb 100644 --- a/src/gnome/modest-icon-names.h +++ b/src/gnome/modest-icon-names.h @@ -80,7 +80,7 @@ /* #define MODEST_FOLDER_ICON_LOCAL_FOLDERS PIXMAP_PREFIX "qgn_list_gene_fldr_cls.png" */ #define MODEST_FOLDER_ICON_LOCAL_FOLDERS "computer" #define MODEST_FOLDER_ICON_MMC "media-flash" - +#define MODEST_FOLDER_ICON_MMC_FOLDER MODEST_FOLDER_ICON_NORMAL /* toolbar */ #define MODEST_TOOLBAR_ICON_MAIL_SEND PIXMAP_PREFIX "qgn_list_messagin_sent.png" diff --git a/src/hildon2/modest-icon-names.h b/src/hildon2/modest-icon-names.h index e0b33af..b93f367 100644 --- a/src/hildon2/modest-icon-names.h +++ b/src/hildon2/modest-icon-names.h @@ -74,7 +74,7 @@ #define MODEST_FOLDER_ICON_NORMAL "general_folder" #define MODEST_FOLDER_ICON_LOCAL_FOLDERS "general_device_root_folder" #define MODEST_FOLDER_ICON_MMC "general_removable_memory_card" - +#define MODEST_FOLDER_ICON_MMC_FOLDER "general_removable_memory_card" /* toolbar */ #define MODEST_TOOLBAR_ICON_MAIL_SEND "email_message_send" diff --git a/src/maemo/modest-icon-names.h b/src/maemo/modest-icon-names.h index 5ab97e1..896a51c 100644 --- a/src/maemo/modest-icon-names.h +++ b/src/maemo/modest-icon-names.h @@ -74,7 +74,7 @@ #define MODEST_FOLDER_ICON_NORMAL "qgn_list_gene_fldr_cls" #define MODEST_FOLDER_ICON_LOCAL_FOLDERS "qgn_list_shell_mydevice" #define MODEST_FOLDER_ICON_MMC "qgn_list_gene_mmc" - +#define MODEST_FOLDER_ICON_MMC_FOLDER MODEST_FOLDER_ICON_NORMAL /* toolbar */ #define MODEST_TOOLBAR_ICON_MAIL_SEND "qgn_toolb_messagin_send" diff --git a/src/modest-tny-folder.c b/src/modest-tny-folder.c index 8188eeb..f29fef7 100644 --- a/src/modest-tny-folder.c +++ b/src/modest-tny-folder.c @@ -255,9 +255,9 @@ gboolean modest_tny_folder_is_memory_card_folder (TnyFolder *folder) { g_return_val_if_fail (folder, FALSE); - - /* The merge folder is a special case, - * used to merge the per-account local outbox folders. + + /* The merge folder is a special case, + * used to merge the per-account local outbox folders. * and can have no get_account() implementation. */ if (TNY_IS_MERGE_FOLDER (folder)) @@ -268,15 +268,15 @@ modest_tny_folder_is_memory_card_folder (TnyFolder *folder) return FALSE; const gchar* account_id = tny_account_get_id (account); - if (!account_id) { + if (!account_id) { g_object_unref (account); return FALSE; } g_object_unref (account); - + return (strcmp (account_id, MODEST_MMC_ACCOUNT_ID) == 0); -} +} gboolean modest_tny_folder_is_remote_folder (TnyFolder *folder) diff --git a/src/widgets/modest-folder-view.c b/src/widgets/modest-folder-view.c index b6b8e9f..eddc33f 100644 --- a/src/widgets/modest-folder-view.c +++ b/src/widgets/modest-folder-view.c @@ -777,7 +777,7 @@ get_composite_icons (const gchar *icon_code, return retval; } -static ThreePixbufs* +static inline ThreePixbufs* get_folder_icons (TnyFolderType type, GObject *instance) { static GdkPixbuf *inbox_pixbuf = NULL, *outbox_pixbuf = NULL, @@ -819,6 +819,8 @@ get_folder_icons (TnyFolderType type, GObject *instance) } switch (type) { + const gchar *icon_code; + case TNY_FOLDER_TYPE_INVALID: g_warning ("%s: BUG: TNY_FOLDER_TYPE_INVALID", __FUNCTION__); break; @@ -886,7 +888,13 @@ get_folder_icons (TnyFolderType type, GObject *instance) break; case TNY_FOLDER_TYPE_NORMAL: default: - retval = get_composite_icons (MODEST_FOLDER_ICON_NORMAL, + /* Memory card folders could have an special icon */ + if (modest_tny_folder_is_memory_card_folder (TNY_FOLDER (instance))) + icon_code = MODEST_FOLDER_ICON_MMC_FOLDER; + else + icon_code = MODEST_FOLDER_ICON_NORMAL; + + retval = get_composite_icons (icon_code, &normal_pixbuf, &normal_pixbuf_open, &normal_pixbuf_close);