diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-09-03 01:21:08 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-09-03 01:37:31 +0800 |
commit | 429234ff213ba04b6d0b02a28ed68aaa8af7c02c (patch) | |
tree | 69fd485d98a78148137ab29e5c1e8d16add7c0f1 /shell | |
parent | cccdb143a571cde36db9fe906864647aab546cff (diff) | |
download | gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.tar gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.tar.gz gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.tar.bz2 gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.tar.lz gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.tar.xz gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.tar.zst gsoc2013-evolution-429234ff213ba04b6d0b02a28ed68aaa8af7c02c.zip |
Convert composer autosave to an EExtension.
Given the way the autosave feature was awkwardly bolted on to the
composer, an EExtension seemed like a natural fit. And it helped
clean up some object lifecycle hacks (and bugs).
What we have now is a new module consisting of two EExtensions:
EComposerAutosave extends EMsgComposer and determines when to
kick off an asynchronous autosave operation.
EComposerRegistry extends EShell and offers to restore orphaned
autosave files on startup (which is also asynchronous now).
e-autosave-utils.c holds the actual asynchronous functions and a few
other miscellaneous utility functions.
Source code for the new module lives in /modules/composer-autosave.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/shell/e-shell.c b/shell/e-shell.c index fcb3d9abf3..db9efc9331 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -180,6 +180,16 @@ shell_window_focus_in_event_cb (EShell *shell, return FALSE; } +static gboolean +shell_emit_window_destroyed_cb (EShell *shell) +{ + g_signal_emit (shell, signals[WINDOW_DESTROYED], 0); + + g_object_unref (shell); + + return FALSE; +} + static void shell_window_weak_notify_cb (EShell *shell, GObject *where_the_object_was) @@ -190,7 +200,12 @@ shell_window_weak_notify_cb (EShell *shell, list = g_list_remove (list, where_the_object_was); shell->priv->watched_windows = list; - g_signal_emit (shell, signals[WINDOW_DESTROYED], 0); + /* Let the watched window finish finalizing itself before we + * emit the "window-destroyed" signal, which may trigger the + * application to initiate shutdown. */ + g_idle_add ( + (GSourceFunc) shell_emit_window_destroyed_cb, + g_object_ref (shell)); } static void |