@@ -228,27 +228,6 @@ class QgsBrowserTreeFilterProxyModel : public QSortFilterProxyModel
228228 // accept anything else
229229 return true ;
230230 }
231-
232- bool lessThan ( const QModelIndex &left,
233- const QModelIndex &right ) const
234- {
235- // sort file items by name (a file item is not a directory and its parent is a directory)
236- // this is necessary because more several providers can add items to a directory and
237- // alphabetical sorting is not preserved
238- QgsDataItem* leftItem = mModel ->dataItem ( left );
239- QgsDataItem* rightItem = mModel ->dataItem ( right );
240- if ( leftItem && leftItem->type () != QgsDataItem::Directory &&
241- leftItem->parent () && leftItem->parent ()->type () == QgsDataItem::Directory &&
242- rightItem && rightItem->type () != QgsDataItem::Directory &&
243- rightItem->parent () && rightItem->parent ()->type () == QgsDataItem::Directory )
244- {
245- return QString::localeAwareCompare ( leftItem->name (), rightItem->name () ) < 0 ;
246- }
247-
248- // default is to keep original order
249- return left.row () < right.row ();
250- }
251-
252231};
253232QgsBrowserDockWidget::QgsBrowserDockWidget ( QString name, QWidget * parent ) :
254233 QDockWidget( parent ), mModel( NULL ), mProxyModel( NULL )
@@ -321,7 +300,6 @@ void QgsBrowserDockWidget::showEvent( QShowEvent * e )
321300
322301 mProxyModel = new QgsBrowserTreeFilterProxyModel ( this );
323302 mProxyModel ->setBrowserModel ( mModel );
324- mProxyModel ->sort ( 0 );
325303 mBrowserView ->setModel ( mProxyModel );
326304 // provide a horizontal scroll bar instead of using ellipse (...) for longer items
327305 mBrowserView ->setTextElideMode ( Qt::ElideNone );
0 commit comments