-2007-06-26 Murray Cumming,,, <murrayc@murrayc-desktop>
-
- reviewed by: <delete if not using a buddy>
-
- * src/modest-tny-account-store.c: (get_password):
-
* please check the svn log instead
2007-06-26 Murray Cumming <murrayc@murrayc.com>
+ * src/modest-tny-account-store.c:
+ * src/modest-tny-account-store.h:
+ Added modest_tny_account_is_memory_card_account().
+ * src/maemo/modest-main-window.c: (create_details_widget):
+ Show the same information items for the memory card as we show for the
+ local-folders, to fix projects.maemo.org bug NB#59307.
+
+2007-06-26 Murray Cumming <murrayc@murrayc.com>
+
* src/modest-tny-account-store.c: (get_password):
Added some checks for NULL to maybe prevent crashes, though I think
it was Philip's last commit that actually prevented the crash here
static GtkWidget *
create_details_widget (GtkWidget *styled_widget, TnyAccount *account)
{
+ /* TODO: Clean up this function. It's a mess, with lots of copy/paste. murrayc. */
+
GtkWidget *vbox;
GtkWidget *label_w;
gchar *label;
#endif
/* Account description: */
- if (modest_tny_account_is_virtual_local_folders (account)) {
+ if (modest_tny_account_is_virtual_local_folders (account)
+ || (modest_tny_account_is_memory_card_account (account))) {
gchar *tmp;
/* Local folders: */
/* Get device name */
- gchar *device_name = modest_conf_get_string (modest_runtime_get_conf(),
+ gchar *device_name = NULL;
+ if (modest_tny_account_is_virtual_local_folders (account))
+ device_name = modest_conf_get_string (modest_runtime_get_conf(),
MODEST_CONF_DEVICE_NAME, NULL);
- tmp = g_strdup_printf (_("mcen_fi_localroot_description"), "");
+ else
+ device_name = g_strdup (tny_account_get_name (account));
+
+ tmp = g_strdup_printf (_("mcen_fi_localroot_description"), ""); //TODO: Why the ""?
label = g_markup_printf_escaped ("<span color='%s'>%s</span>%s",
gray_color_markup, tmp, device_name);
g_free (tmp);
g_free (label);
/* Size / Date */
- if (modest_tny_account_is_virtual_local_folders (account)) {
+ if (modest_tny_account_is_virtual_local_folders (account)
+ || modest_tny_account_is_memory_card_account (account)) {
/* FIXME: format size */
label = g_markup_printf_escaped ("<span color='%s'>%s:</span> %d",
gray_color_markup, _("mcen_fi_rootfolder_size"),
return MODEST_IS_TNY_LOCAL_FOLDERS_ACCOUNT (self);
}
+
+gboolean
+modest_tny_account_is_memory_card_account (TnyAccount *self)
+{
+ if (!self)
+ return FALSE;
+
+ const gchar* account_id = tny_account_get_id (self);
+ if (!account_id)
+ return FALSE;
+
+ return (strcmp (account_id, MODEST_MMC_ACCOUNT_ID) == 0);
+}
+
TnyAccount*
modest_tny_account_store_get_local_folders_account (TnyAccountStore *self)
{
return account;
}
+
+
**/
gboolean modest_tny_account_is_virtual_local_folders (TnyAccount *self);
+/** modest_tny_account_is_memory_card_account:
+ * @self A TnyAccount.
+ *
+ * A convenience function to identify whether TnyAccount
+ * is the memory card account.
+ **/
+gboolean
+modest_tny_account_is_memory_card_account (TnyAccount *self);
+
G_END_DECLS
#endif /* __MODEST_TNY_ACCOUNT_STORE_H__ */