[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Fri Sep 11 22:39:11 CEST 2009
SVN commit 1022475 by tgridel:
dead code
M +1 -1 AbstractFileViewItem.h
M +1 -2 GpxFileViewItem.cpp
M +1 -1 GpxFileViewItem.h
M +2 -2 KmlFileViewItem.cpp
M +1 -1 KmlFileViewItem.h
M +3 -47 MarblePlacemarkModel.cpp
M +2 -19 MarblePlacemarkModel.h
M +1 -1 MarbleRunnerManager.cpp
M +1 -1 PlacemarkManager.cpp
--- trunk/KDE/kdeedu/marble/src/lib/AbstractFileViewItem.h #1022474:1022475
@@ -27,7 +27,7 @@
virtual ~AbstractFileViewItem() {};
virtual void saveFile() = 0;
- virtual void closeFile( int start, bool finalize = true ) = 0;
+ virtual void closeFile( int start ) = 0;
virtual int size() const { return 0; };
virtual bool isShown() const = 0;
virtual void setShown( bool value ) = 0;
--- trunk/KDE/kdeedu/marble/src/lib/GpxFileViewItem.cpp #1022474:1022475
@@ -55,10 +55,9 @@
stream << ( *m_gpxFile );
}
-void GpxFileViewItem::closeFile( int start, bool finalize )
+void GpxFileViewItem::closeFile( int start )
{
Q_UNUSED( start );
- Q_UNUSED( finalize );
//TODO
}
--- trunk/KDE/kdeedu/marble/src/lib/GpxFileViewItem.h #1022474:1022475
@@ -34,7 +34,7 @@
* AbstractFileViewItem methods
*/
virtual void saveFile();
- virtual void closeFile( int start, bool finalize = true );
+ virtual void closeFile( int start );
virtual bool isShown() const;
virtual void setShown( bool value );
virtual QString name() const;
--- trunk/KDE/kdeedu/marble/src/lib/KmlFileViewItem.cpp #1022474:1022475
@@ -42,10 +42,10 @@
return &m_document;
}
-void KmlFileViewItem::closeFile( int start, bool finalize )
+void KmlFileViewItem::closeFile( int start )
{
qDebug() << "closing file" << m_document.name() << m_document.fileName();
- m_fileManager.dataFacade()->placemarkModel()->removePlacemarks( m_document.fileName(), start, size(), finalize );
+ m_fileManager.dataFacade()->placemarkModel()->removePlacemarks( m_document.fileName(), start, size() );
}
int KmlFileViewItem::size() const
--- trunk/KDE/kdeedu/marble/src/lib/KmlFileViewItem.h #1022474:1022475
@@ -31,7 +31,7 @@
* AbstractFileViewItem methods
*/
virtual void saveFile();
- virtual void closeFile( int start, bool finalize = true );
+ virtual void closeFile( int start );
virtual bool isShown() const;
virtual void setShown( bool value );
virtual int size() const;
--- trunk/KDE/kdeedu/marble/src/lib/MarblePlacemarkModel.cpp #1022474:1022475
@@ -52,7 +52,7 @@
MarblePlacemarkModel::~MarblePlacemarkModel()
{
- clearPlacemarks();
+ d->m_placemarkContainer.clear();
delete d;
}
@@ -73,24 +73,6 @@
return 0;
}
-GeoDataCoordinates MarblePlacemarkModel::coordinateData( const QModelIndex &index ) const
-{
- if ( !index.isValid() ) {
- qDebug() << "MarblePlacemarkModel: Error - index invalid";
- return GeoDataCoordinates();
- }
- return d->m_placemarkContainer.at( index.row() ).coordinate();
-}
-
-GeoDataStyle* MarblePlacemarkModel::styleData( const QModelIndex &index ) const
-{
- if ( !index.isValid() )
- return 0;
- else {
- return d->m_placemarkContainer.at( index.row() ).style();
- }
-}
-
QVariant MarblePlacemarkModel::data( const QModelIndex &index, int role ) const
{
if ( !index.isValid() )
@@ -167,23 +149,11 @@
return results;
}
-void MarblePlacemarkModel::addPlacemarks( QVector<Marble::GeoDataPlacemark> &placemarks,
- bool clearPrevious,
- bool finalize )
+void MarblePlacemarkModel::addPlacemarks( QVector<Marble::GeoDataPlacemark> &placemarks )
{
- Q_UNUSED( finalize )
-
if( placemarks.count() <= 0 )
return;
- if ( clearPrevious ) {
- beginRemoveRows( QModelIndex(), 0, rowCount() );
-
- d->m_placemarkContainer.clear();
-
- endRemoveRows();
- }
-
const int length = d->m_placemarkContainer.count();
beginInsertRows( QModelIndex(), length, length + placemarks.count() - 1 );
createFilterProperties( placemarks );
@@ -196,11 +166,8 @@
void MarblePlacemarkModel::removePlacemarks( const QString &containerName,
int start,
- int length,
- bool finalize )
+ int length )
{
- Q_UNUSED( finalize )
-
QTime t;
t.start();
@@ -215,17 +182,6 @@
qDebug() << "removePlacemarks(" << containerName << "): Time elapsed:" << t.elapsed() << "ms for" << length << "Placemarks.";
}
-QStringList MarblePlacemarkModel::containers() const
-{
- return QStringList();
-}
-
-void MarblePlacemarkModel::clearPlacemarks()
-{
- d->m_placemarkContainer.clear();
- reset();
-}
-
void MarblePlacemarkModel::createFilterProperties( QVector<Marble::GeoDataPlacemark> &container )
{
--- trunk/KDE/kdeedu/marble/src/lib/MarblePlacemarkModel.h #1022474:1022475
@@ -80,9 +80,6 @@
int rowCount( const QModelIndex &parent = QModelIndex() ) const;
int columnCount( const QModelIndex &parent = QModelIndex() ) const;
- Marble::GeoDataCoordinates coordinateData( const QModelIndex &index ) const;
- Marble::GeoDataStyle* styleData( const QModelIndex &index ) const;
-
/**
* Return the data according to the index.
*
@@ -101,9 +98,7 @@
*
* Note: The model takes ownership of the place marks!
*/
- void addPlacemarks( QVector<Marble::GeoDataPlacemark> &placemarks,
- bool clearPrevious = false,
- bool finalize = true );
+ void addPlacemarks( QVector<Marble::GeoDataPlacemark> &placemarks );
/**
* This method is used by the PlacemarkManager to remove
@@ -113,14 +108,8 @@
*/
void removePlacemarks( const QString &containerName,
int start,
- int length,
- bool finalize = true );
+ int length );
- /**
- * This method returns a list of open Containers (== open kml files)
- */
- QStringList containers() const;
-
Q_SIGNALS:
/**
* @brief Signal that the persistant Index has been updated
@@ -129,12 +118,6 @@
private:
- /**
- * This method is used by the PlacemarkManager to clear
- * the model.
- */
- void clearPlacemarks();
-
void createFilterProperties( QVector<Marble::GeoDataPlacemark> &container );
Q_DISABLE_COPY( MarblePlacemarkModel )
--- trunk/KDE/kdeedu/marble/src/lib/MarbleRunnerManager.cpp #1022474:1022475
@@ -94,7 +94,7 @@
if( result.isEmpty() )
return;
- m_model->addPlacemarks( result, false );
+ m_model->addPlacemarks( result );
emit modelChanged( m_model );
}
--- trunk/KDE/kdeedu/marble/src/lib/PlacemarkManager.cpp #1022474:1022475
@@ -77,7 +77,7 @@
{
// d->m_placemarkContainer << document->placemarks();
QVector<GeoDataPlacemark> result = document.placemarks();
- d->m_datafacade->placemarkModel()->addPlacemarks( result, false );
+ d->m_datafacade->placemarkModel()->addPlacemarks( result );
}
}
More information about the Marble-commits
mailing list