[Marble-commits] KDE/kdeedu/marble/src/lib

Thibaut Gridel tgridel at free.fr
Sat Jul 17 00:34:54 CEST 2010


SVN commit 1150826 by tgridel:

fix updates of MarblePlacemarkModel:

- the sort proxies should use dynamic sorting to react to changes
- removing a document should call layoutChanged as proxies don't update otherwise

 M  +1 -1      MarbleControlBox.cpp  
 M  +2 -2      MarbleModel.cpp  
 M  +1 -0      MarblePlacemarkModel.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/MarbleControlBox.cpp #1150825:1150826
@@ -387,7 +387,7 @@
     t.start();
     d->m_sortproxy->setSourceModel( locations );
     d->m_sortproxy->setSortLocaleAware( true );
-    d->m_sortproxy->setDynamicSortFilter( false );
+    d->m_sortproxy->setDynamicSortFilter( true );
     d->m_sortproxy->sort( 0 );
     qDebug("MarbleControlBox (sort): Time elapsed: %d ms", t.elapsed());
 }
--- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #1150825:1150826
@@ -189,7 +189,7 @@
 
     d->m_popSortModel->setSourceModel( d->m_dataFacade->placemarkModel() );
 //    d->m_popSortModel->setSortLocaleAware( true );
-//    d->m_popSortModel->setDynamicSortFilter( true );
+    d->m_popSortModel->setDynamicSortFilter( true );
     d->m_popSortModel->setSortRole( MarblePlacemarkModel::PopularityIndexRole );
     d->m_popSortModel->sort( 0, Qt::DescendingOrder );
     
@@ -199,7 +199,7 @@
     connect( d->m_placemarkselectionmodel,  SIGNAL( selectionChanged( QItemSelection,
                                                                       QItemSelection) ),
              d->m_placemarkLayout,          SLOT( requestStyleReset() ) );
-    connect( d->m_dataFacade->placemarkModel(),           SIGNAL( layoutChanged() ),
+    connect( d->m_popSortModel,           SIGNAL( layoutChanged() ),
              d->m_placemarkLayout,          SLOT( requestStyleReset() ) );
 
     /*
--- trunk/KDE/kdeedu/marble/src/lib/MarblePlacemarkModel.cpp #1150825:1150826
@@ -182,6 +182,7 @@
     beginRemoveRows( QModelIndex(), start, start + length );
     d->m_size -= length;
     endRemoveRows();
+    emit layoutChanged();
     mDebug() << "removePlacemarks(" << containerName << "): Time elapsed:" << t.elapsed() << "ms for" << length << "Placemarks.";
 }
 


More information about the Marble-commits mailing list