[gnome-photos] tracker-controller: Consolidate the path to submitting a query
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] tracker-controller: Consolidate the path to submitting a query
- Date: Fri, 9 Oct 2015 11:08:12 +0000 (UTC)
commit e7ec28a755124d73cc52dbe5268e9a2ea45b1402
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Oct 7 19:21:13 2015 +0200
tracker-controller: Consolidate the path to submitting a query
... so that it is easier to freeze the TrackerControllers.
We don't want to call photos_tracker_controller_set_query_status when
reacting to PhotosOffsetController::offset-changed because the
ViewModels get cleared when the query status is TRUE. Let's handle this
by introducing a new flag.
https://bugzilla.gnome.org/show_bug.cgi?id=741593
src/photos-tracker-controller.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-tracker-controller.c b/src/photos-tracker-controller.c
index c4a4501..a47b59b 100644
--- a/src/photos-tracker-controller.c
+++ b/src/photos-tracker-controller.c
@@ -1,6 +1,6 @@
/*
* Photos - access, organize and share your photos on GNOME
- * Copyright © 2012, 2013, 2014 Red Hat, Inc.
+ * Copyright © 2012, 2013, 2014, 2015 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -84,7 +84,8 @@ G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (PhotosTrackerController, photos_tracker_con
typedef enum
{
PHOTOS_TRACKER_REFRESH_FLAGS_NONE = 0,
- PHOTOS_TRACKER_REFRESH_FLAGS_RESET_OFFSET = 1 << 0
+ PHOTOS_TRACKER_REFRESH_FLAGS_DONT_SET_QUERY_STATUS = 1 << 0,
+ PHOTOS_TRACKER_REFRESH_FLAGS_RESET_OFFSET = 1 << 1,
} PhotosTrackerRefreshFlags;
static void photos_tracker_controller_refresh_internal (PhotosTrackerController *self, gint flags);
@@ -206,7 +207,7 @@ photos_tracker_controller_perform_current_query (PhotosTrackerController *self)
static void
photos_tracker_controller_offset_changed (PhotosTrackerController *self)
{
- photos_tracker_controller_perform_current_query (self);
+ photos_tracker_controller_refresh_internal (self, PHOTOS_TRACKER_REFRESH_FLAGS_DONT_SET_QUERY_STATUS);
}
@@ -253,7 +254,9 @@ photos_tracker_controller_refresh_internal (PhotosTrackerController *self, gint
return;
}
- photos_tracker_controller_set_query_status (self, TRUE);
+ if (!(flags & PHOTOS_TRACKER_REFRESH_FLAGS_DONT_SET_QUERY_STATUS))
+ photos_tracker_controller_set_query_status (self, TRUE);
+
photos_tracker_controller_perform_current_query (self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]