[Marble-devel] [PATCH 8/8] MarbleControlBox: fix sorting of placemarks

Thibaut GRIDEL tgridel at free.fr
Tue Sep 1 23:24:36 CEST 2009


 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/MarbleControlBox.cpp b/src/lib/MarbleControlBox.cpp
index 885dda6..1e5565b 100644
--- a/src/lib/MarbleControlBox.cpp
+++ b/src/lib/MarbleControlBox.cpp
@@ -128,6 +128,8 @@ MarbleControlBox::MarbleControlBox(QWidget *parent)
     d->m_currentLocation2Widget = d->uiWidget.toolBox->currentWidget();
 
     d->m_sortproxy = new QSortFilterProxyModel( d->uiWidget.locationListView );
+    d->m_sortproxy->setSortLocaleAware( true );
+    d->m_sortproxy->setDynamicSortFilter( true );
     d->uiWidget.locationListView->setModel( d->m_sortproxy );
 
     d->m_mapSortProxy = new MapThemeSortFilterProxyModel( this );
@@ -360,11 +362,14 @@ void MarbleControlBox::setWidgetTabShown( QWidget * widget,
 
 void MarbleControlBox::setLocations(MarblePlacemarkModel* locations)
 {
+    if (locations == d->m_sortproxy->sourceModel() )
+    {
+        return;
+    }
+
     QTime t;
     t.start();
     d->m_sortproxy->setSourceModel( locations );
-    d->m_sortproxy->setSortLocaleAware( true );
-    d->m_sortproxy->setDynamicSortFilter( false );
     d->m_sortproxy->sort( 0 );
     qDebug("MarbleControlBox (sort): Time elapsed: %d ms", t.elapsed());
 }
-- 
1.6.3.3





More information about the Marble-devel mailing list