[libhandy/tabs: 7/62] Stop using g_list_store_find()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy/tabs: 7/62] Stop using g_list_store_find()
- Date: Sat, 12 Sep 2020 19:27:43 +0000 (UTC)
commit 366a6882a6c62c6d55bf021038585c88b6ec0864
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Thu Sep 3 22:20:14 2020 +0500
Stop using g_list_store_find()
Apparently that's too new for Debian
src/hdy-tab-view.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/hdy-tab-view.c b/src/hdy-tab-view.c
index 34ba182e..80cac047 100644
--- a/src/hdy-tab-view.c
+++ b/src/hdy-tab-view.c
@@ -1989,14 +1989,19 @@ guint
hdy_tab_view_get_page_position (HdyTabView *self,
HdyTabPage *page)
{
- guint pos;
+ guint i;
g_return_val_if_fail (HDY_IS_TAB_VIEW (self), 0);
g_return_val_if_fail (HDY_IS_TAB_PAGE (page), 0);
- g_return_val_if_fail (g_list_store_find (self->pages, page, &pos), 0);
+ for (i = 0; i < self->n_pages; i++) {
+ HdyTabPage *p = hdy_tab_view_get_nth_page (self, i);
+
+ if (page == p)
+ return i;
+ }
- return pos;
+ return 0;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]