src/qt3support/itemviews/q3listview.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
equal deleted inserted replaced
29:b72c6db6890b 30:5dc02b23752f
  1322     lso = ascending;
  1322     lso = ascending;
  1323 
  1323 
  1324     const int nColumns = (listView() ? listView()->columns() : 0);
  1324     const int nColumns = (listView() ? listView()->columns() : 0);
  1325 
  1325 
  1326     // and don't sort if we already have the right sorting order
  1326     // and don't sort if we already have the right sorting order
  1327     if (column > nColumns || childItem == 0 || childItem->siblingItem == 0)
  1327     if (column > nColumns || childItem == 0)
  1328         return;
  1328         return;
       
  1329     
       
  1330     // If there is just one child, just sort its children
       
  1331     if (childItem->siblingItem == 0) {
       
  1332         if (childItem->isOpen())
       
  1333             childItem->sortChildItems(column, ascending);
       
  1334         return;
       
  1335     }
  1329 
  1336 
  1330     // make an array for qHeapSort()
  1337     // make an array for qHeapSort()
  1331     Q3ListViewPrivate::SortableItem * siblings
  1338     Q3ListViewPrivate::SortableItem * siblings
  1332         = new Q3ListViewPrivate::SortableItem[nChildren];
  1339         = new Q3ListViewPrivate::SortableItem[nChildren];
  1333     Q3ListViewItem * s = childItem;
  1340     Q3ListViewItem * s = childItem;