[evolution-kolab] EPlugin: write back "show all folders" to store
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] EPlugin: write back "show all folders" to store
- Date: Thu, 18 Oct 2012 12:30:03 +0000 (UTC)
commit f92b3e7f712cc398282773912d7f930d869a0ca6
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Wed Oct 17 17:19:04 2012 +0200
EPlugin: write back "show all folders" to store
* if changed, write the "Show all folders in this
Kolab account" user setting into the
CamelKolabIMAPXStore when the "Kolab Folder
Properties..." dialog is closed
src/eplugin/e-kolab-folder-metadata.c | 23 ++++++++++++++++++++---
src/eplugin/e-kolab-folder-metadata.h | 3 ++-
2 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/src/eplugin/e-kolab-folder-metadata.c b/src/eplugin/e-kolab-folder-metadata.c
index dbbc1ed..5046fec 100644
--- a/src/eplugin/e-kolab-folder-metadata.c
+++ b/src/eplugin/e-kolab-folder-metadata.c
@@ -103,7 +103,7 @@ kolab_folder_metadata_ui_foldertype_cb (GtkRadioButton *btn,
if ((foldertype > KOLAB_FOLDER_TYPE_INVAL) &&
(foldertype < KOLAB_FOLDER_LAST_TYPE)) {
uidata->metadata->foldertype = foldertype;
- uidata->changed = TRUE;
+ uidata->changed_metadata = TRUE;
}
ok_btn = e_kolab_plugin_util_ui_dialog_ref_button (uidata->dialog,
@@ -128,6 +128,7 @@ kolab_folder_metadata_ui_show_all_cb (GtkToggleButton *btn,
g_return_if_fail (uidata->metadata != NULL);
uidata->metadata->show_all = !(uidata->metadata->show_all);
+ uidata->changed_visibility = TRUE;
ok_btn = e_kolab_plugin_util_ui_dialog_ref_button (uidata->dialog,
GTK_STOCK_OK,
@@ -160,7 +161,8 @@ e_kolab_folder_metadata_ui_new (void)
uidata->dialog = NULL;
uidata->foldername = NULL;
uidata->sourcename = NULL;
- uidata->changed = FALSE;
+ uidata->changed_metadata = FALSE;
+ uidata->changed_visibility = FALSE;
uidata->widgets = g_new0 (KolabFolderMetaUIWidgets, 1);
uidata->metadata = kolab_data_folder_metadata_new ();
@@ -435,7 +437,7 @@ e_kolab_folder_metadata_ui_write_store (KolabFolderMetaUIData *uidata,
g_return_val_if_fail (E_IS_SHELL_VIEW (uidata->shell_view), FALSE);
g_return_val_if_fail (uidata->metadata != NULL, FALSE);
- if (! uidata->changed)
+ if (! (uidata->changed_metadata || uidata->changed_visibility))
return TRUE;
ok = e_kolab_plugin_util_ui_get_selected_store (uidata->shell_view,
@@ -449,11 +451,26 @@ e_kolab_folder_metadata_ui_write_store (KolabFolderMetaUIData *uidata,
g_warning ("%s()[%u] foldername change: stored '%s' vs. current '%s'",
__func__, __LINE__, uidata->foldername, selected_path);
+ if (! uidata->metadata)
+ goto metadata_skip;
+
ok = camel_kolab_imapx_store_set_folder_type (kstore,
uidata->foldername,
uidata->metadata->foldertype,
cancellable,
&tmp_err);
+ if (! ok)
+ goto exit;
+
+ metadata_skip:
+
+ if (! uidata->changed_visibility)
+ goto exit;
+
+ ok = camel_kolab_imapx_store_set_show_all_folders (kstore,
+ uidata->metadata->show_all,
+ cancellable,
+ &tmp_err);
exit:
if (tmp_err != NULL) {
diff --git a/src/eplugin/e-kolab-folder-metadata.h b/src/eplugin/e-kolab-folder-metadata.h
index 583deab..619b533 100644
--- a/src/eplugin/e-kolab-folder-metadata.h
+++ b/src/eplugin/e-kolab-folder-metadata.h
@@ -69,7 +69,8 @@ struct _KolabFolderMetaUIData {
KolabDataFolderMetadata *metadata;
gchar *foldername;
gchar *sourcename;
- gboolean changed;
+ gboolean changed_metadata;
+ gboolean changed_visibility;
};
/*----------------------------------------------------------------------------*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]