Merge lp:~3v1n0/bamf/view-children-avoid-reload into lp:bamf

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 572
Merged at revision: 551
Proposed branch: lp:~3v1n0/bamf/view-children-avoid-reload
Merge into: lp:bamf
Diff against target: 48 lines (+7/-2)
1 file modified
lib/libbamf/bamf-view.c (+7/-2)
To merge this branch: bzr merge lp:~3v1n0/bamf/view-children-avoid-reload
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Andrea Azzarone (community) Approve
Review via email: mp+169258@code.launchpad.net

Commit message

BamfView: don't try to reload the children if they're empty but we already tried once

This finally mutes the "Unable to fetch children" warning... \o/

Description of the change

If the children list of an bamf-view is empty because we've just removed the last children on a "children-removed" signal, we shouldn't try to ask again to the deaemon if it is really the case, we can trust to the signal and avoid to do further requests until the daemon lives.

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) :
review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/libbamf/bamf-view.c'
2--- lib/libbamf/bamf-view.c 2013-06-13 15:54:29 +0000
3+++ lib/libbamf/bamf-view.c 2013-06-13 16:59:27 +0000
4@@ -85,9 +85,10 @@
5 gchar *type;
6 gchar *local_icon;
7 gchar *local_name;
8+ GList *cached_children;
9+ gboolean reload_children;
10 gboolean is_closed;
11 gboolean sticky;
12- GList *cached_children;
13 };
14
15 static void bamf_view_unset_proxy (BamfView *self);
16@@ -121,7 +122,7 @@
17
18 priv = view->priv;
19
20- if (priv->cached_children)
21+ if (priv->cached_children || !priv->reload_children)
22 return g_list_copy (priv->cached_children);
23
24 if (!_bamf_dbus_item_view_call_children_sync (priv->proxy, &children, CANCELLABLE (view), &error))
25@@ -146,7 +147,9 @@
26 }
27 }
28
29+ priv->reload_children = FALSE;
30 priv->cached_children = results;
31+
32 return g_list_copy (priv->cached_children);
33 }
34
35@@ -534,6 +537,7 @@
36 if (self->priv->cached_children)
37 {
38 g_list_free_full (self->priv->cached_children, g_object_unref);
39+ self->priv->reload_children = TRUE;
40 self->priv->cached_children = NULL;
41 }
42
43@@ -963,4 +967,5 @@
44 priv = self->priv = BAMF_VIEW_GET_PRIVATE (self);
45 priv->cancellable = g_cancellable_new ();
46 priv->is_closed = TRUE;
47+ priv->reload_children = TRUE;
48 }

Subscribers

People subscribed via source and target branches