aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-02-24 20:24:15 +0800
committerMilan Crha <mcrha@redhat.com>2011-02-24 20:24:15 +0800
commitfde6eab197d3e3c253d8479eb9bd1a377a426fa4 (patch)
treec5c69774bb4cbe5cd1463413ec246c1cc367dc0d /shell
parente1e00c0587fd7c659850776206d2f6bef3e117fa (diff)
downloadgsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.tar
gsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.tar.gz
gsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.tar.bz2
gsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.tar.lz
gsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.tar.xz
gsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.tar.zst
gsoc2013-evolution-fde6eab197d3e3c253d8479eb9bd1a377a426fa4.zip
Write state.ini immediately in EShellView::dispose method
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-view.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 87ec90d058..6911b54f59 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -247,7 +247,7 @@ shell_view_save_state_done_cb (GFile *file,
}
static EActivity *
-shell_view_save_state (EShellView *shell_view)
+shell_view_save_state (EShellView *shell_view, gboolean immediately)
{
EShellBackend *shell_backend;
SaveStateData *data;
@@ -266,6 +266,15 @@ shell_view_save_state (EShellView *shell_view)
g_return_val_if_fail (contents != NULL, NULL);
path = g_build_filename (config_dir, "state.ini", NULL);
+ if (immediately) {
+ g_file_set_contents (path, contents, -1, NULL);
+
+ g_free (path);
+ g_free (contents);
+
+ return NULL;
+ }
+
file = g_file_new_for_path (path);
g_free (path);
@@ -301,7 +310,7 @@ shell_view_state_timeout_cb (EShellView *shell_view)
if (shell_view->priv->state_save_activity != NULL)
return TRUE;
- activity = shell_view_save_state (shell_view);
+ activity = shell_view_save_state (shell_view, FALSE);
/* Set up a weak pointer that gets set to NULL when the
* activity finishes. This will tell us if we're still
@@ -496,7 +505,7 @@ shell_view_dispose (GObject *object)
g_source_remove (priv->state_save_timeout_id);
priv->state_save_timeout_id = 0;
if (priv->state_save_activity == NULL)
- shell_view_save_state (E_SHELL_VIEW (object));
+ shell_view_save_state (E_SHELL_VIEW (object), TRUE);
}
if (priv->state_save_activity != NULL) {