aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-folder.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-05-21 02:38:10 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-05-21 02:38:10 +0800
commit3682e0ef1f2d736ced6cff11dd4c5e87dd0fd6d8 (patch)
tree2d98889e5975b20c25dfd8e2984d0083774cdab9 /shell/e-folder.c
parent97d578613baab00205b157c2cd87baed41dbcf5f (diff)
downloadgsoc2013-evolution-3682e0ef1f2d736ced6cff11dd4c5e87dd0fd6d8.tar.gz
gsoc2013-evolution-3682e0ef1f2d736ced6cff11dd4c5e87dd0fd6d8.tar.zst
gsoc2013-evolution-3682e0ef1f2d736ced6cff11dd4c5e87dd0fd6d8.zip
Remove exception. (cancelSyncFolder): Remove exception.
* Evolution-Offline.idl (syncFolder): Remove exception. (cancelSyncFolder): Remove exception. * e-shell-config-offline.c (storage_set_view_has_checkbox_func): New. (e_shell_config_offline_create_control): Pass it as the @has_checkbox_func. * e-folder.c: New member can_sync_offline in EFolderPrivate. (init): Init to FALSE. (e_folder_get_can_sync_offline): New. (e_folder_to_corba): Set canSyncOffline in the returned CORBA folder. (e_folder_set_physical_uri): Protect from when @physical_uri and ->physical_uri are the same thing. (e_folder_set_description): Same here with description. (e_folder_set_type_string): And type. * Evolution-common.idl: New member canSyncOffline in struct Folder. svn path=/trunk/; revision=16946
Diffstat (limited to 'shell/e-folder.c')
-rw-r--r--shell/e-folder.c60
1 files changed, 44 insertions, 16 deletions
diff --git a/shell/e-folder.c b/shell/e-folder.c
index 0de3160a74..3c2669f0bd 100644
--- a/shell/e-folder.c
+++ b/shell/e-folder.c
@@ -46,8 +46,9 @@ struct _EFolderPrivate {
int child_highlight;
int unread_count;
- int self_highlight : 1;
- int is_stock : 1;
+ unsigned int self_highlight : 1;
+ unsigned int is_stock : 1;
+ unsigned int can_sync_offline : 1;
};
#define EF_CLASS(obj) \
@@ -148,14 +149,15 @@ init (EFolder *folder)
EFolderPrivate *priv;
priv = g_new (EFolderPrivate, 1);
- priv->type = NULL;
- priv->name = NULL;
- priv->description = NULL;
- priv->physical_uri = NULL;
- priv->child_highlight = 0;
- priv->unread_count = 0;
- priv->self_highlight = FALSE;
- priv->is_stock = FALSE;
+ priv->type = NULL;
+ priv->name = NULL;
+ priv->description = NULL;
+ priv->physical_uri = NULL;
+ priv->child_highlight = 0;
+ priv->unread_count = 0;
+ priv->self_highlight = FALSE;
+ priv->is_stock = FALSE;
+ priv->can_sync_offline = FALSE;
folder->priv = priv;
}
@@ -274,6 +276,9 @@ e_folder_set_name (EFolder *folder,
g_return_if_fail (E_IS_FOLDER (folder));
g_return_if_fail (name != NULL);
+ if (folder->priv->name == name)
+ return;
+
g_free (folder->priv->name);
folder->priv->name = g_strdup (name);
@@ -316,6 +321,9 @@ e_folder_set_physical_uri (EFolder *folder,
g_return_if_fail (E_IS_FOLDER (folder));
g_return_if_fail (physical_uri != NULL);
+ if (folder->priv->physical_uri == physical_uri)
+ return;
+
g_free (folder->priv->physical_uri);
folder->priv->physical_uri = g_strdup (physical_uri);
@@ -361,6 +369,25 @@ e_folder_set_is_stock (EFolder *folder,
gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]);
}
+void
+e_folder_set_can_sync_offline (EFolder *folder,
+ gboolean can_sync_offline)
+{
+ g_return_if_fail (E_IS_FOLDER (folder));
+
+ folder->priv->can_sync_offline = !! can_sync_offline;
+
+ gtk_signal_emit (GTK_OBJECT (folder), signals[CHANGED]);
+}
+
+gboolean
+e_folder_get_can_sync_offline (EFolder *folder)
+{
+ g_return_val_if_fail (E_IS_FOLDER (folder), FALSE);
+
+ return folder->priv->can_sync_offline;
+}
+
/* Gotta love CORBA. */
@@ -372,12 +399,13 @@ e_folder_to_corba (EFolder *folder,
g_return_if_fail (E_IS_FOLDER (folder));
g_return_if_fail (folder_return != NULL);
- folder_return->type = e_safe_corba_string_dup (e_folder_get_type_string (folder));
- folder_return->description = e_safe_corba_string_dup (e_folder_get_description (folder));
- folder_return->displayName = e_safe_corba_string_dup (e_folder_get_name (folder));
- folder_return->physicalUri = e_safe_corba_string_dup (e_folder_get_physical_uri (folder));
- folder_return->evolutionUri = e_safe_corba_string_dup (evolution_uri);
- folder_return->unreadCount = e_folder_get_unread_count (folder);
+ folder_return->type = e_safe_corba_string_dup (e_folder_get_type_string (folder));
+ folder_return->description = e_safe_corba_string_dup (e_folder_get_description (folder));
+ folder_return->displayName = e_safe_corba_string_dup (e_folder_get_name (folder));
+ folder_return->physicalUri = e_safe_corba_string_dup (e_folder_get_physical_uri (folder));
+ folder_return->evolutionUri = e_safe_corba_string_dup (evolution_uri);
+ folder_return->unreadCount = e_folder_get_unread_count (folder);
+ folder_return->canSyncOffline = e_folder_get_can_sync_offline (folder);
}