[gnome-todo] sidebar: Fix listbox sorting function
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] sidebar: Fix listbox sorting function
- Date: Sun, 9 Jun 2019 19:51:15 +0000 (UTC)
commit efe194f5de9642cb0beec2ccd20cd2a650de8942
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jun 8 21:51:19 2019 -0300
sidebar: Fix listbox sorting function
It should consider the archive row now.
src/sidebar/gtd-sidebar.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/src/sidebar/gtd-sidebar.c b/src/sidebar/gtd-sidebar.c
index fda3444..a7678d1 100644
--- a/src/sidebar/gtd-sidebar.c
+++ b/src/sidebar/gtd-sidebar.c
@@ -432,6 +432,17 @@ sort_listbox_cb (GtkListBoxRow *row_a,
GtkListBoxRow *row_b,
gpointer user_data)
{
+ GtdSidebar *self = GTD_SIDEBAR (user_data);
+
+ /* Special-case the Archive row */
+ if (row_a == self->archive_row || row_b == self->archive_row)
+ {
+ if (GTD_IS_SIDEBAR_PANEL_ROW (row_b))
+ return 1;
+ else
+ return -1;
+ }
+
if (G_OBJECT_TYPE (row_a) != G_OBJECT_TYPE (row_b))
{
gint result;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]