[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Tue Sep 22 22:24:39 CEST 2009
SVN commit 1026913 by tgridel:
MarblePlacemarkModel: fix model size bug leading to unsorted Placemarks
M +5 -1 MarblePlacemarkModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarblePlacemarkModel.cpp #1026912:1026913
@@ -30,6 +30,7 @@
public:
Private()
+ : m_size(0)
{
}
@@ -37,6 +38,7 @@
{
}
+ int m_size;
QVector<Marble::GeoDataPlacemark> *m_placemarkContainer;
};
@@ -63,7 +65,7 @@
int MarblePlacemarkModel::rowCount( const QModelIndex &parent ) const
{
if ( !parent.isValid() )
- return d->m_placemarkContainer->size();
+ return d->m_size;
else
return 0;
}
@@ -158,6 +160,7 @@
QTime t;
t.start();
beginInsertRows( QModelIndex(), start, start + length );
+ d->m_size += length;
endInsertRows();
emit layoutChanged();
qDebug() << "addPlacemarks: Time elapsed:" << t.elapsed() << "ms for" << length << "Placemarks.";
@@ -170,6 +173,7 @@
QTime t;
t.start();
beginRemoveRows( QModelIndex(), start, start + length );
+ d->m_size -= length;
endRemoveRows();
emit layoutChanged();
qDebug() << "removePlacemarks(" << containerName << "): Time elapsed:" << t.elapsed() << "ms for" << length << "Placemarks.";
More information about the Marble-commits
mailing list