[planner: 1/32] list-model: Fix get_path vfunc implementation




commit b6be9579e965413be6e635ac4df865fa4c81d692
Author: Mart Raudsepp <leio gentoo org>
Date:   Sun Jun 13 20:40:23 2021 +0300

    list-model: Fix get_path vfunc implementation
    
    The GtkTreeModelIface::get_path() implementation was always returning
    NULL, due to comparing the wrong pointer while trying to find the match.
    This didn't appear to cause big problems in GTK 2, as the vfunc just
    wasn't called in usual situations. However in GTK 3, at least since
    upstream commit e53dc3479f8 ("Added GtkCellAreaClass->apply_attributes()")
    it is called in the main code paths, and failure to return the correct
    path results in editable cell renderers not knowing what they are editing,
    throwing critical warnings on loading and crashing when something gets
    edited.
    
    This fixes Task Properties edit dialog "Resources" and "Predecessors" tabs
    tree views, and probably more.

 src/planner-list-model.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/planner-list-model.c b/src/planner-list-model.c
index 1a0bec2a..0a4d11c1 100644
--- a/src/planner-list-model.c
+++ b/src/planner-list-model.c
@@ -227,7 +227,7 @@ mlm_get_path (GtkTreeModel *tree_model,
 
         for (node = priv->data_list; node; node = node->next)
         {
-                if ((gpointer)node->data == (gpointer)iter->user_data)
+                if ((gpointer)node == (gpointer)iter->user_data)
                         break;
                 i++;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]