[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Sun Dec 26 14:55:09 CET 2010
SVN commit 1209326 by tgridel:
no need for a MarbleplacemarkModel where an QAbstractItemModel is enough
M +1 -1 MarbleDataFacade.cpp
M +2 -1 MarbleDataFacade.h
M +2 -2 NavigationWidget.cpp
M +4 -4 PlacemarkManager.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarbleDataFacade.cpp #1209325:1209326
@@ -104,7 +104,7 @@
return d->m_model->positionTracking();
}
-MarblePlacemarkModel* MarbleDataFacade::placemarkModel()
+QAbstractItemModel* MarbleDataFacade::placemarkModel()
{
return d->m_placemarkmodel;
}
--- trunk/KDE/kdeedu/marble/src/lib/MarbleDataFacade.h #1209325:1209326
@@ -32,6 +32,7 @@
#include "global.h"
+class QAbstractItemModel;
namespace Marble
{
@@ -81,7 +82,7 @@
PositionTracking* positionTracking() const;
- MarblePlacemarkModel* placemarkModel();
+ QAbstractItemModel* placemarkModel();
FileViewModel* fileViewModel() const;
--- trunk/KDE/kdeedu/marble/src/lib/NavigationWidget.cpp #1209325:1209326
@@ -110,7 +110,7 @@
// Make us aware of all the Placemarks in the MarbleModel so that
// we can search them.
- setLocations( static_cast<MarblePlacemarkModel*>( d->m_widget->placemarkModel() ) );
+ setLocations( d->m_widget->placemarkModel() );
// FIXME: Why does this fail: "selection model works on a different model than the view..." ?
// d->m_navigationUi.locationListView->setSelectionModel( d->m_widget->placemarkSelectionModel() );
@@ -162,7 +162,7 @@
d->m_searchTerm = search;
// if search line is empty, restore original geonames
if ( d->m_searchTerm.isEmpty() )
- setLocations( static_cast<MarblePlacemarkModel*>( d->m_widget->placemarkModel() ) );
+ setLocations( d->m_widget->placemarkModel() );
if ( d->m_searchTriggered )
return;
d->m_searchTriggered = true;
--- trunk/KDE/kdeedu/marble/src/lib/PlacemarkManager.cpp #1209325:1209326
@@ -65,13 +65,13 @@
MarblePlacemarkModel* PlacemarkManager::model() const
{
- return d->m_datafacade->placemarkModel();
+ return static_cast<MarblePlacemarkModel*>(d->m_datafacade->placemarkModel());
}
void PlacemarkManager::setDataFacade( MarbleDataFacade *facade )
{
d->m_datafacade = facade;
- d->m_datafacade->placemarkModel()->setPlacemarkContainer(&d->m_placemarkContainer);
+ model()->setPlacemarkContainer(&d->m_placemarkContainer);
}
void PlacemarkManager::setFileManager( FileManager *fileManager )
@@ -102,7 +102,7 @@
d->m_sizeForDocument[index] = result.size();
mDebug() << "PlacemarkManager::addGeoDataDocument:"
<< document.fileName() << " size " << result.size();
- d->m_datafacade->placemarkModel()->addPlacemarks( start, result.size() );
+ model()->addPlacemarks( start, result.size() );
}
}
@@ -125,7 +125,7 @@
d->m_sizeForDocument.remove(index);
mDebug() << "PlacemarkManager::removeGeoDataDocument:"
<< document.fileName() << " size " << size;
- d->m_datafacade->placemarkModel()->removePlacemarks(
+ model()->removePlacemarks(
document.fileName(), start, size );
}
}
More information about the Marble-commits
mailing list