[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sun Dec 26 14:55:02 CET 2010
SVN commit 1209325 by tgridel:
no need for MarblePlacemarkModel when a simple QAbstractItemModel is enough
M +2 -8 MarbleSearchListView.cpp
M +2 -2 NavigationWidget.cpp
M +2 -1 NavigationWidget.h
--- trunk/KDE/kdeedu/marble/src/lib/MarbleSearchListView.cpp #1209324:1209325
@@ -11,8 +11,6 @@
#include "MarbleSearchListView.h"
-#include "MarblePlacemarkModel.h"
-
#include "MarbleDebug.h"
#include <QtGui/QStandardItemModel>
@@ -40,15 +38,11 @@
if ( model() )
{
- MarblePlacemarkModel *placemarkModel = (MarblePlacemarkModel *)model();
- if ( placemarkModel )
- {
- QModelIndex firstIndex = placemarkModel->index( 0, 0 );
- resultlist = placemarkModel->approxMatch( firstIndex,
+ QModelIndex firstIndex = model()->index( 0, 0 );
+ resultlist = model()->match( firstIndex,
Qt::DisplayRole, text, 1,
Qt::MatchStartsWith );
}
- }
if ( resultlist.size() > 0 ) {
setCurrentIndex( resultlist[0] );
--- trunk/KDE/kdeedu/marble/src/lib/NavigationWidget.cpp #1209324:1209325
@@ -103,7 +103,7 @@
{
d->m_runnerManager = new MarbleRunnerManager( widget->model()->pluginManager(), this );
connect( d->m_runnerManager, SIGNAL( searchResultChanged( MarblePlacemarkModel* ) ),
- this, SLOT( setLocations( MarblePlacemarkModel* ) ) );
+ this, SLOT( setLocations( QAbstractItemModel* ) ) );
d->m_widget = widget;
d->m_runnerManager->setModel( widget->model() );
@@ -186,7 +186,7 @@
d->m_navigationUi.locationListView->activate();
}
-void NavigationWidget::setLocations(MarblePlacemarkModel* locations)
+void NavigationWidget::setLocations(QAbstractItemModel* locations)
{
QTime t;
t.start();
--- trunk/KDE/kdeedu/marble/src/lib/NavigationWidget.h #1209324:1209325
@@ -21,6 +21,7 @@
#include <QtGui/QWidget>
class QModelIndex;
+class QAbstractItemModel;
namespace Marble
{
@@ -113,7 +114,7 @@
* them.
* @see centerOn
*/
- void setLocations( MarblePlacemarkModel* locations );
+ void setLocations( QAbstractItemModel* locations );
void selectTheme( const QString & );
More information about the Marble-commits
mailing list