From 224f26b84d9c12b0dd1d337f51c14b6ebb901007 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 4 Sep 2011 09:48:24 -0400 Subject: GtkApplication has some new EShell-like features. I pushed a few EShell features up to GtkApplication for GTK+ 3.2, so we can now trim off the redundancies in EShell. 1) GtkApplication has a new "window-added" signal which replaces EShell's own "window-created" signal. 2) GtkApplication has a new "window-removed" signal which replaces EShell's own "window-destroyed" signal. 3) gtk_application_get_windows() now returns a list of windows sorted by most recently focused, replacing e_shell_get_watched_windows(). 4) GtkApplication now provides enough hooks to subclasses that we can remove e_shell_watch_window() and call gtk_application_add_window() directly. --- modules/composer-autosave/e-composer-registry.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'modules/composer-autosave') diff --git a/modules/composer-autosave/e-composer-registry.c b/modules/composer-autosave/e-composer-registry.c index 9fcba43ff9..3b69e166a7 100644 --- a/modules/composer-autosave/e-composer-registry.c +++ b/modules/composer-autosave/e-composer-registry.c @@ -149,9 +149,9 @@ composer_registry_notify_cb (EComposerRegistry *registry, } static void -composer_registry_window_created_cb (EShell *shell, - GtkWindow *window, - EComposerRegistry *registry) +composer_registry_window_added_cb (GtkApplication *application, + GtkWindow *window, + EComposerRegistry *registry) { /* Offer to restore any orphaned auto-save files from the * previous session once the first EShellWindow is mapped. */ @@ -201,8 +201,8 @@ composer_registry_constructed (GObject *object) /* Listen for new watched windows. */ g_signal_connect ( - extensible, "window-created", - G_CALLBACK (composer_registry_window_created_cb), + extensible, "window-added", + G_CALLBACK (composer_registry_window_added_cb), object); } -- cgit v1.2.3 From 126aa2398abc1bbab0fd0cd76fda5042cc83fe76 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 6 Oct 2011 09:35:14 -0400 Subject: Prefer g_simple_async_result_take_error(). Slightly more efficient and convenient than: g_simple_async_result_set_from_error (simple, error); g_error_free (error); One less GError to copy and destroy. --- modules/composer-autosave/e-autosave-utils.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'modules/composer-autosave') diff --git a/modules/composer-autosave/e-autosave-utils.c b/modules/composer-autosave/e-autosave-utils.c index 9c5eaa8236..8d03aaaecc 100644 --- a/modules/composer-autosave/e-autosave-utils.c +++ b/modules/composer-autosave/e-autosave-utils.c @@ -137,9 +137,8 @@ load_snapshot_loaded_cb (GFile *snapshot_file, if (error != NULL) { g_warn_if_fail (contents == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); - g_error_free (error); return; } @@ -154,10 +153,9 @@ load_snapshot_loaded_cb (GFile *snapshot_file, g_free (contents); if (error != NULL) { - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (message); - g_error_free (error); return; } @@ -192,10 +190,8 @@ save_snapshot_splice_cb (GOutputStream *output_stream, g_output_stream_splice_finish (output_stream, result, &error); - if (error != NULL) { - g_simple_async_result_set_from_error (simple, error); - g_error_free (error); - } + if (error != NULL) + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); @@ -220,10 +216,9 @@ save_snapshot_get_message_cb (EMsgComposer *composer, if (error != NULL) { g_warn_if_fail (message == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); - g_error_free (error); return; } @@ -281,10 +276,9 @@ save_snapshot_replace_cb (GFile *snapshot_file, if (error != NULL) { g_warn_if_fail (output_stream == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); - g_error_free (error); return; } @@ -480,10 +474,9 @@ e_composer_save_snapshot (EMsgComposer *composer, if (error != NULL) { g_warn_if_fail (snapshot_file == NULL); - g_simple_async_result_set_from_error (simple, error); + g_simple_async_result_take_error (simple, error); g_simple_async_result_complete (simple); g_object_unref (simple); - g_error_free (error); return; } -- cgit v1.2.3