diff options
author | Milan Crha <mcrha@redhat.com> | 2011-02-24 20:24:15 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:37 +0800 |
commit | 8850d234553f203fd16f377db07ccfe514ca6776 (patch) | |
tree | 1a6e8e0ec96707468dfe56711aa38fb9338e4e80 /shell | |
parent | 57e58ac4add6d9f3d0918c7431dbf7c1fa655d14 (diff) | |
download | gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.tar gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.tar.gz gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.tar.bz2 gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.tar.lz gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.tar.xz gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.tar.zst gsoc2013-evolution-8850d234553f203fd16f377db07ccfe514ca6776.zip |
Write state.ini immediately in EShellView::dispose method
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-view.c | 15 |
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) { |