Ignore the expander "hot spots" in folderview for childless folders.
[claws.git] / src / gtk / gtksctree.c
index f08a8b8dc226bc0f5c69da36b5c52201bdcac1eb..343b5dba72dae86ff407e94f99a2966382a6422e 100644 (file)
@@ -324,7 +324,7 @@ select_range (GtkSCTree *sctree, gint row)
        if (row < prev_row) {
                min = row;
                max = prev_row;
-               GTK_CMCLIST(sctree)->focus_row = max;
+               GTK_CMCLIST(sctree)->focus_row = min;
        } else {
                min = prev_row;
                max = row;
@@ -431,6 +431,8 @@ sctree_is_hot_spot (GtkSCTree     *sctree,
     return FALSE;
 
   tree_row = GTK_CMCTREE_ROW (node);
+  if (!tree_row->children)
+    return FALSE;
 
   hotspot_size = clist->row_height-2;
   if (hotspot_size > clist->column[ctree->tree_column].area.width - 2)
@@ -1451,7 +1453,7 @@ gtk_sctree_link (GtkCMCTree     *ctree,
 
                        list_end->next = work->next;
                        if (work->next)
-                               list = work->next->prev = list_end;
+                               work->next->prev = list_end;
                        work->next = (GList *)node;
                        list = (GList *)node;
                        list->prev = work;
@@ -1584,13 +1586,8 @@ srow_new (GtkCMCTree *ctree)
   int i;
 
   clist = GTK_CMCLIST (ctree);
-#if GLIB_CHECK_VERSION(2,10,0)
   ctree_row = g_slice_new (GtkCMCTreeRow);
   ctree_row->row.cell = g_slice_alloc (sizeof (GtkCMCell) * clist->columns);
-#else
-  ctree_row = g_chunk_new (GtkCMCTreeRow, (GMemChunk *)clist->row_mem_chunk);
-  ctree_row->row.cell = g_chunk_new (GtkCMCell, (GMemChunk *)clist->cell_mem_chunk);
-#endif
   for (i = 0; i < clist->columns; i++)
     {
       ctree_row->row.cell[i].type = GTK_CMCELL_EMPTY;
@@ -1669,13 +1666,8 @@ srow_delete (GtkCMCTree    *ctree,
       dnotify (ddata);
     }
 
-#if GLIB_CHECK_VERSION(2,10,0)  
   g_slice_free1 (sizeof (GtkCMCell) * clist->columns, ctree_row->row.cell);
   g_slice_free (GtkCMCTreeRow, ctree_row);
-#else
-  g_mem_chunk_free ((GMemChunk *)clist->cell_mem_chunk, ctree_row->row.cell);
-  g_mem_chunk_free ((GMemChunk *)clist->row_mem_chunk, ctree_row);
-#endif
 }
 
 static void
@@ -2053,13 +2045,6 @@ void gtk_sctree_set_column_tooltip           (GtkSCTree          *sctree,
                                             int                 column,
                                             const gchar        *tip)
 {
-#if !(GTK_CHECK_VERSION(2,12,0))
-       GtkTooltips *tips;
-       if (!sctree->tooltips)
-               sctree->tooltips = gtk_tooltips_new();
-       tips = sctree->tooltips;
-#endif
-
        CLAWS_SET_TIP(GTK_CMCLIST(sctree)->column[column].button,
                        tip);
 }