[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdeedu/marble
From:       Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date:       2011-03-25 12:23:12
Message-ID: 20110325122312.6394CAC8CE () svn ! kde ! org
[Download RAW message or body]

SVN commit 1225969 by beschow:

provide data via MarbleModel only; do not forward in MarbleWidget and MarbleMap \
(patch 1 of 5)

* remove GeoData methods from MarbleWidget + MarbleMap

 M  +15 -0     docs/release_notes/APIChanges-0.12.txt  
 M  +5 -0      src/ControlView.cpp  
 M  +1 -1      src/ControlView.h  
 M  +1 -1      src/MarbleTest.cpp  
 M  +1 -1      src/QtMainWindow.cpp  
 M  +0 -35     src/lib/MarbleMap.cpp  
 M  +0 -47     src/lib/MarbleMap.h  
 M  +0 -36     src/lib/MarbleWidget.cpp  
 M  +0 -52     src/lib/MarbleWidget.h  
 M  +1 -1      src/marble_part.cpp  
 M  +2 -1      src/plugins/render/fileview/FileViewFloatItem.cpp  


--- trunk/KDE/kdeedu/marble/docs/release_notes/APIChanges-0.12.txt #1225968:1225969
@@ -12,3 +12,18 @@
   to be able to implement lazy loading of dialogs without cheating. Lazy
   creation of these dialogs is recommended to avoid wasting resources
   for dialogs that are likely not used.
+
+
+2011-03-25  Bernhard Beschow <bbeschow@cs.tu-berlin.de>
+
+* Remove the following methods from MarbleMap and MarbleWidget:
+   void addGeoDataFile( const QString &filename );
+   void addGeoDataString( const QString& data, const QString& key = "data" );
+   void removeGeoData( const QString& key );
+    -> use the respective methods of MarbleModel
+   void openGpxFile( const QString &filename );
+    -> use MarbleModel::addGeoDataFile(...);
+   MARBLE_DEPRECATED( void addPlacemarkFile( const QString &filename ) );
+   MARBLE_DEPRECATED( void addPlacemarkData( const QString& data, const QString& key \
= "data" ) ); +   MARBLE_DEPRECATED( void removePlacemarkKey( const QString& key ) );
+    -> use addGeoDataFile, addGeoDataString, removeGeoData of MarbleModel
--- trunk/KDE/kdeedu/marble/src/ControlView.cpp #1225968:1225969
@@ -549,6 +549,11 @@
     return m_splitter ? m_splitter->restoreState( state ) : false;
 }
 
+void ControlView::addGeoDataFile( QString filename )
+{
+    m_marbleWidget->model()->addGeoDataFile( filename );
 }
 
+}
+
 #include "ControlView.moc"
--- trunk/KDE/kdeedu/marble/src/ControlView.h #1225968:1225969
@@ -64,7 +64,7 @@
 
     bool setSideBarState( const QByteArray &state );
 
-    void addGeoDataFile( QString filename ) { m_marbleWidget->addGeoDataFile( \
filename ); } +    void addGeoDataFile( QString filename );
 
     QPixmap mapScreenShot() { return m_marbleWidget->mapScreenShot(); }
     
--- trunk/KDE/kdeedu/marble/src/MarbleTest.cpp #1225968:1225969
@@ -78,7 +78,7 @@
             "GPS Data (*.gpx);;KML (*.kml)");
     
     if ( ! fileName.isNull() ) {
-        m_marbleWidget->addGeoDataFile( fileName );
+        m_marbleWidget->model()->addGeoDataFile( fileName );
     }
    
     QTime t;
--- trunk/KDE/kdeedu/marble/src/QtMainWindow.cpp #1225968:1225969
@@ -829,7 +829,7 @@
                             tr("All Supported Files (*.gpx *.kml *.pnt);;GPS Data \
(*.gpx);;Google Earth KML (*.kml);; Micro World Database II (*.pnt)"));  
     foreach( const QString &fileName, fileNames ) {
-        m_controlView->marbleWidget()->addGeoDataFile( fileName );
+        m_controlView->marbleWidget()->model()->addGeoDataFile( fileName );
     }
 }
 
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1225968:1225969
@@ -460,21 +460,6 @@
     return 2100;
 }
 
-void MarbleMap::addPlacemarkFile( const QString &filename )
-{
-    addGeoDataFile( filename );
-}
-
-void MarbleMap::addPlacemarkData( const QString &data, const QString &key )
-{
-    addGeoDataString( data, key );
-}
-
-void MarbleMap::removePlacemarkKey( const QString &key )
-{
-    removeGeoData( key );
-}
-
 QVector<const GeoDataPlacemark*> MarbleMap::whichFeatureAt( const QPoint& curpos ) \
const  {
     return d->m_placemarkLayout.whichPlacemarkAt( curpos );
@@ -1064,11 +1049,6 @@
     }
 }
 
-void MarbleMap::openGpxFile( const QString &filename )
-{
-    addGeoDataFile( filename );
-}
-
 FileViewModel* MarbleMap::fileViewModel() const
 {
     return d->m_model->fileViewModel();
@@ -1256,21 +1236,6 @@
     return d->zoom( radiusFromDistance( distance ) );
 }
 
-void MarbleMap::addGeoDataFile( const QString &filename )
-{
-    d->m_model->addGeoDataFile( filename );
-}
-
-void MarbleMap::addGeoDataString( const QString& data, const QString& key )
-{
-    d->m_model->addGeoDataString( data, key );
-}
-
-void MarbleMap::removeGeoData( const QString& key )
-{
-    d->m_model->removeGeoData( key );
-}
-
 // this method will only temporarily "pollute" the MarbleModel class
 TextureLayer* MarbleMap::textureLayer()
 {
--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.h #1225968:1225969
@@ -233,28 +233,6 @@
      */
     QItemSelectionModel *placemarkSelectionModel() const;
 
-    /**
-     * @brief  Add a GeoData file to the model. Supported file types are .pnt, .gpx \
                and .kml
-     * @param  filename  the filename of the file containing the Placemarks.
-     * @deprecated This method has been renamed addGeoDataFile
-     */
-    MARBLE_DEPRECATED( void addPlacemarkFile( const QString &filename ) );
-
-    /**
-     * @brief  Add GeoData data as string to the model.
-     * @param  data  the string containing the Placemarks.
-     * @param key  the string needed to identify the data
-     * @deprecated This method has been renamed addGeoDataString
-     */
-    MARBLE_DEPRECATED( void addPlacemarkData( const QString& data, const QString& \
                key = "data" ) );
-
-    /**
-     * @brief  remove data or files from the model.
-     * @param key  either the filename or the string used to identify the data in \
                addPlacemarkFile and addPlacemarkData
-     * @deprecated This method has been renamed removeGeoData
-     */
-    MARBLE_DEPRECATED( void removePlacemarkKey( const QString& key ) );
-
     QVector<const GeoDataPlacemark*> whichFeatureAt( const QPoint& ) const;
 
     /**
@@ -715,31 +693,6 @@
     void notifyMouseClick( int x, int y );
 
     /**
-     * @brief Opens a gpx file for viewing on the Marble Map
-     * @deprecated Please use addGeoDataFile instead
-     */
-    void openGpxFile( const QString &filename );
-
-    /**
-     * @brief  Add a GeoData file to the model. Supported file types are .pnt, .gpx \
                and .kml
-     * @param  filename  the filename of the file containing the data to be loaded.
-     */
-    void addGeoDataFile( const QString &filename );
-
-    /**
-     * @brief  Add GeoData data as string to the model.
-     * @param  data  the string containing the Placemarks.
-     * @param key  the string needed to identify the data
-     */
-    void addGeoDataString( const QString& data, const QString& key = "data" );
-
-    /**
-     * @brief  remove data or files from the model.
-     * @param key  either the filename or the string used to identify the data in \
                addGeoDataFile and addGeoDataString
-     */
-    void removeGeoData( const QString& key );
-
-    /**
      * @brief Return a QAbstractItemModel containing files.
      */
     FileViewModel* fileViewModel() const;
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.cpp #1225968:1225969
@@ -378,21 +378,6 @@
     return d->m_map->maximumZoom();
 }
 
-void MarbleWidget::addPlacemarkFile( const QString &filename )
-{
-    addGeoDataFile( filename );
-}
-
-void MarbleWidget::addPlacemarkData( const QString &data, const QString &key )
-{
-    addGeoDataString( data, key );
-}
-
-void MarbleWidget::removePlacemarkKey( const QString &key )
-{
-    removeGeoData( key );
-}
-
 QVector<const GeoDataPlacemark*> MarbleWidget::whichFeatureAt( const QPoint &curpos \
) const  {
     return d->m_map->whichFeatureAt( curpos );
@@ -1013,11 +998,6 @@
     }
 }
 
-void MarbleWidget::openGpxFile( const QString &filename )
-{
-    addGeoDataFile( filename );
-}
-
 FileViewModel* MarbleWidget::fileViewModel() const
 {
     return d->m_model->fileViewModel();
@@ -1348,22 +1328,6 @@
     return d->m_routingLayer;
 }
 
-void MarbleWidget::addGeoDataFile( const QString &filename )
-{
-    d->m_map->addGeoDataFile( filename );
-    //d->m_model->addGeoDataFile( filename );
 }
 
-void MarbleWidget::addGeoDataString( const QString &data, const QString &key )
-{
-    d->m_map->addGeoDataString( data, key );
-}
-
-void MarbleWidget::removeGeoData( const QString &key )
-{
-    d->m_map->removeGeoData( key );
-}
-
-}
-
 #include "MarbleWidget.moc"
--- trunk/KDE/kdeedu/marble/src/lib/MarbleWidget.h #1225968:1225969
@@ -412,28 +412,6 @@
      */
     QItemSelectionModel *placemarkSelectionModel() const;
 
-    /**
-     * @brief  Add a GeoDataPlacemark file to the model. Supported file types are \
                .pnt, .gpx and .kml
-     * @param  filename  the filename of the file containing the Placemarks.
-     * @deprecated Please use addGeoDataFile instead
-     */
-    MARBLE_DEPRECATED( void addPlacemarkFile( const QString &filename ) );
-
-    /**
-     * @brief  Add GeoDataPlacemark data as string to the model.
-     * @param  data  the string containing the Placemarks.
-     * @param key  the string needed to identify the data
-     * @deprecated Please use addGeoDataString instead
-     */
-    MARBLE_DEPRECATED( void addPlacemarkData( const QString& data, const QString& \
                key = "data" ) );
-
-    /**
-     * @brief  remove data or files from the model.
-     * @param key  either the filename or the string used to identify the data in \
                addPlacemarkFile and addPlacemarkData
-     * @deprecated Please use removeGeoData instead
-     */
-    MARBLE_DEPRECATED( void removePlacemarkKey( const QString& key ) );
-
     QVector<const GeoDataPlacemark*> whichFeatureAt( const QPoint& ) const;
 
     /// @name Float items and map appearance
@@ -946,36 +924,6 @@
 
     //@}
 
-    /// @name Geo data management slots
-    //@{
-
-    /**
-     * @brief Opens a gpx file for viewing on the Marble Widget
-     * @deprecated Please use addGeoDataFile instead
-     */
-    void openGpxFile( const QString &filename );
-
-    /**
-     * @brief  Add a GeoData file to the model. Supported file types are .pnt, .gpx \
                and .kml
-     * @param  filename  the filename of the file containing the data to be loaded.
-     */
-    void addGeoDataFile( const QString &filename );
-
-    /**
-     * @brief  Add GeoData data as string to the model.
-     * @param  data  the string containing the Placemarks.
-     * @param  key  the string needed to identify the data
-     */
-    void addGeoDataString( const QString& data, const QString& key = "data" );
-
-    /**
-     * @brief  remove data or files from the model.
-     * @param key  either the filename or the string used to identify the data in \
                addGeoDataFile and addGeoDataString
-     */
-    void removeGeoData( const QString& key );
-
-    //@}
-
     /// @name Tile management slots
     //@{
 
--- trunk/KDE/kdeedu/marble/src/marble_part.cpp #1225968:1225969
@@ -214,7 +214,7 @@
                                             widget(), i18n("Open File")
                                            );
     foreach( const QString &fileName, fileNames ) {
-        m_controlView->marbleWidget()->addGeoDataFile( fileName );
+        m_controlView->marbleWidget()->model()->addGeoDataFile( fileName );
     }
 
     return true;
--- trunk/KDE/kdeedu/marble/src/plugins/render/fileview/FileViewFloatItem.cpp \
#1225968:1225969 @@ -26,6 +26,7 @@
 #include "GeoPainter.h"
 #include "ViewportParams.h"
 #include "MarbleWidget.h"
+#include "MarbleModel.h"
 #include "MarbleDataFacade.h"
 
 
@@ -232,7 +233,7 @@
                                             tr("All Supported Files (*.gpx *.kml \
*.pnt);;GPS Data (*.gpx);;Google Earth KML (*.kml);PNT Data (*.pnt)"));  
     if ( ! fileName.isEmpty() ) {
-        m_marbleWidget->addGeoDataFile( fileName );
+        m_marbleWidget->model()->addGeoDataFile( fileName );
     }
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic