[gnome-photos] base-item: Simplify getting the result of running the print operation
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Simplify getting the result of running the print operation
- Date: Tue, 15 Mar 2016 09:49:38 +0000 (UTC)
commit 771d7abf7cb15e7380899711df932a9fc291d369
Author: Rafael Fonseca <r4f4rfs gmail com>
Date: Tue Mar 15 10:40:50 2016 +0100
base-item: Simplify getting the result of running the print operation
https://bugzilla.gnome.org/show_bug.cgi?id=763500
src/photos-base-item.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 74592fe..00912ac 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1443,38 +1443,26 @@ photos_base_item_populate_from_cursor (PhotosBaseItem *self, TrackerSparqlCursor
static void
-photos_base_item_print_operation_done (PhotosBaseItem *self, GtkPrintOperationResult result)
-{
- if (result == GTK_PRINT_OPERATION_RESULT_APPLY)
- photos_selection_controller_set_selection_mode (self->priv->sel_cntrlr, FALSE);
-}
-
-
-static void
photos_base_item_print_load (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
PhotosBaseItem *self = PHOTOS_BASE_ITEM (source_object);
GtkWindow *toplevel = GTK_WINDOW (user_data);
GeglNode *node;
GtkPrintOperation *print_op = NULL;
+ GtkPrintOperationResult print_res;
node = photos_base_item_load_finish (self, res, NULL);
if (node == NULL)
goto out;
print_op = photos_print_operation_new (self, node);
- g_signal_connect_data (print_op,
- "done",
- G_CALLBACK (photos_base_item_print_operation_done),
- g_object_ref (self),
- (GClosureNotify) g_object_unref,
- G_CONNECT_SWAPPED);
-
/* It is self managing. */
photos_print_notification_new (print_op);
- gtk_print_operation_run (print_op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, toplevel, NULL);
+ print_res = gtk_print_operation_run (print_op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, toplevel, NULL);
+ if (print_res == GTK_PRINT_OPERATION_RESULT_APPLY)
+ photos_selection_controller_set_selection_mode (self->priv->sel_cntrlr, FALSE);
out:
g_clear_object (&node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]