[Marble-commits] KDE/kdeedu/marble
Bernhard Beschow
bbeschow at cs.tu-berlin.de
Fri Mar 25 13:23:18 CET 2011
SVN commit 1225971 by beschow:
provide data via MarbleModel only; do not forward in MarbleWidget and MarbleMap (patch 3 of 5)
* Remove the following methods from MarbleMap and MarbleWidget, use the respective methods of
MarbleModel:
FileViewModel * fileViewModel() const;
QAbstractItemModel *placemarkModel() const;
QItemSelectionModel *placemarkSelectionModel() const;
M +8 -0 docs/release_notes/APIChanges-0.12.txt
M +4 -4 src/lib/FileViewWidget.cpp
M +0 -15 src/lib/MarbleMap.cpp
M +0 -16 src/lib/MarbleMap.h
M +0 -15 src/lib/MarbleWidget.cpp
M +2 -16 src/lib/MarbleWidget.h
M +4 -4 src/lib/NavigationWidget.cpp
--- trunk/KDE/kdeedu/marble/docs/release_notes/APIChanges-0.12.txt #1225970:1225971
@@ -34,3 +34,11 @@
* Remove the following methods from MarbleMap and MarbleWidget, use the respective methods of MarbleModel:
void clearPersistentTileCache();
void setPersistentTileCacheLimit( quint64 kiloBytes );
+
+
+2011-03-25 Bernhard Beschow <bbeschow at cs.tu-berlin.de>
+
+* Remove the following methods from MarbleMap and MarbleWidget, use the respective methods of MarbleModel:
+ FileViewModel * fileViewModel() const;
+ QAbstractItemModel *placemarkModel() const;
+ QItemSelectionModel *placemarkSelectionModel() const;
--- trunk/KDE/kdeedu/marble/src/lib/FileViewWidget.cpp #1225970:1225971
@@ -52,17 +52,17 @@
{
d->m_widget = widget;
//set up everything for the FileModel
- d->m_fileViewUi.m_fileView->setModel( widget->fileViewModel() );
+ d->m_fileViewUi.m_fileView->setModel( widget->model()->fileViewModel() );
delete d->m_fileViewUi.m_fileView->selectionModel();
- d->m_fileViewUi.m_fileView->setSelectionModel( widget->fileViewModel()->selectionModel() );
+ d->m_fileViewUi.m_fileView->setSelectionModel( widget->model()->fileViewModel()->selectionModel() );
connect( d->m_fileViewUi.m_fileView->selectionModel(),
SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ),
this,
SLOT( enableFileViewActions() ) );
connect( d->m_fileViewUi.m_saveButton, SIGNAL( clicked() ) ,
- widget->fileViewModel(), SLOT( saveFile() ) );
+ widget->model()->fileViewModel(), SLOT( saveFile() ) );
connect( d->m_fileViewUi.m_closeButton, SIGNAL( clicked() ) ,
- widget->fileViewModel(), SLOT( closeFile() ) );
+ widget->model()->fileViewModel(), SLOT( closeFile() ) );
d->m_treeSortProxy = new QSortFilterProxyModel( this );
d->m_treeSortProxy->setSourceModel( widget->model()->treeModel() );
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1225970:1225971
@@ -363,16 +363,6 @@
}
-QAbstractItemModel *MarbleMap::placemarkModel() const
-{
- return d->m_model->placemarkModel();
-}
-
-QItemSelectionModel *MarbleMap::placemarkSelectionModel() const
-{
- return d->m_model->placemarkSelectionModel();
-}
-
int MarbleMap::zoom() const
{
return d->m_logzoom;
@@ -1049,11 +1039,6 @@
}
}
-FileViewModel* MarbleMap::fileViewModel() const
-{
- return d->m_model->fileViewModel();
-}
-
void MarbleMap::clearVolatileTileCache()
{
d->m_textureLayer.update();
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1225970:1225971
@@ -52,7 +52,6 @@
class MarbleModel;
class ViewportParams;
class SunLocator;
-class FileViewModel;
class GeoPainter;
class LayerInterface;
class RenderPlugin;
@@ -223,16 +222,6 @@
*/
qreal centerLatitude() const;
- /**
- * @brief returns the model for all the placemarks on the globe.
- */
- QAbstractItemModel *placemarkModel() const;
-
- /**
- * @brief returns the selection model for all the placemarks on the globe.
- */
- QItemSelectionModel *placemarkSelectionModel() const;
-
QVector<const GeoDataPlacemark*> whichFeatureAt( const QPoint& ) const;
/**
@@ -692,11 +681,6 @@
*/
void notifyMouseClick( int x, int y );
- /**
- * @brief Return a QAbstractItemModel containing files.
- */
- FileViewModel* fileViewModel() const;
-
void clearVolatileTileCache();
/**
* @brief Set the limit of the volatile (in RAM) tile cache.
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1225970:1225971
@@ -339,16 +339,6 @@
}
-QAbstractItemModel *MarbleWidget::placemarkModel() const
-{
- return d->m_map->placemarkModel();
-}
-
-QItemSelectionModel *MarbleWidget::placemarkSelectionModel() const
-{
- return d->m_map->placemarkSelectionModel();
-}
-
qreal MarbleWidget::moveStep()
{
if ( radius() < sqrt( (qreal)(width() * width() + height() * height()) ) )
@@ -998,11 +988,6 @@
}
}
-FileViewModel* MarbleWidget::fileViewModel() const
-{
- return d->m_model->fileViewModel();
-}
-
void MarbleWidget::clearVolatileTileCache()
{
mDebug() << "About to clear VolatileTileCache";
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.h #1225970:1225971
@@ -39,7 +39,6 @@
class AbstractDataPluginItem;
class AbstractFloatItem;
-class FileViewModel;
class GeoDataLatLonAltBox;
class GeoDataLatLonBox;
class GeoPainter;
@@ -242,11 +241,6 @@
ViewContext viewContext() const;
/**
- * @brief Return a QAbstractItemModel containing files.
- */
- FileViewModel * fileViewModel() const;
-
- /**
* @brief Get the GeoSceneDocument object of the current map theme
*/
GeoSceneDocument * mapTheme() const;
@@ -401,18 +395,10 @@
/// @name Placemark management
//@{
- /**
- * @brief Returns the model for all the placemarks on the globe.
- */
- QAbstractItemModel *placemarkModel() const;
-
- /**
- * @brief Returns the selection model for all the placemarks on the globe.
- */
- QItemSelectionModel *placemarkSelectionModel() const;
-
QVector<const GeoDataPlacemark*> whichFeatureAt( const QPoint& ) const;
+ //@}
+
/// @name Float items and map appearance
//@{
--- trunk/KDE/kdeedu/marble/src/lib/NavigationWidget.cpp #1225970:1225971
@@ -112,7 +112,7 @@
// Make us aware of all the Placemarks in the MarbleModel so that
// we can search them.
- setLocations( d->m_widget->placemarkModel() );
+ setLocations( d->m_widget->model()->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() );
@@ -161,7 +161,7 @@
d->m_searchTerm = search;
// if search line is empty, restore original geonames
if ( d->m_searchTerm.isEmpty() )
- setLocations( d->m_widget->placemarkModel() );
+ setLocations( d->m_widget->model()->placemarkModel() );
d->m_deferSearch.start( 500 );
}
@@ -190,7 +190,7 @@
d->m_sortproxy->setSortLocaleAware( true );
d->m_sortproxy->setDynamicSortFilter( true );
d->m_sortproxy->sort( 0 );
- d->m_widget->placemarkSelectionModel()->clear();
+ d->m_widget->model()->placemarkSelectionModel()->clear();
mDebug() << "NavigationWidget (sort): Time elapsed:"<< t.elapsed() << " ms";
}
@@ -230,7 +230,7 @@
{
GeoDataCoordinates coord = ( dynamic_cast<GeoDataPlacemark*>( object ) )->coordinate();
d->m_widget->centerOn( coord, true );
- d->m_widget->placemarkSelectionModel()->select( d->m_sortproxy->mapToSource( index ), QItemSelectionModel::ClearAndSelect );
+ d->m_widget->model()->placemarkSelectionModel()->select( d->m_sortproxy->mapToSource( index ), QItemSelectionModel::ClearAndSelect );
}
}
More information about the Marble-commits
mailing list