[Marble-commits] KDE/kdeedu/marble/src/lib
Thibaut Gridel
tgridel at free.fr
Fri Sep 11 22:39:22 CEST 2009
SVN commit 1022478 by tgridel:
MarblePlacemarkModel: fix model updates signalling
M +4 -7 MarblePlacemarkModel.cpp
--- trunk/KDE/kdeedu/marble/src/lib/MarblePlacemarkModel.cpp #1022477:1022478
@@ -160,8 +160,7 @@
d->m_placemarkContainer << placemarks;
endInsertRows();
-
- emit dataChanged( index( length, 0 ), index( length + placemarks.count() - 1, 0 ) );
+ emit layoutChanged();
}
void MarblePlacemarkModel::removePlacemarks( const QString &containerName,
@@ -171,14 +170,12 @@
QTime t;
t.start();
- beginRemoveRows( QModelIndex(), 0, length );
+ beginRemoveRows( QModelIndex(), start, start + length );
QVector<Marble::GeoDataPlacemark>::iterator begin = d->m_placemarkContainer.begin() + start;
- QVector<Marble::GeoDataPlacemark>::iterator end = d->m_placemarkContainer.begin() + start + length;
+ QVector<Marble::GeoDataPlacemark>::iterator end = begin + length;
d->m_placemarkContainer.erase(begin, end);
endRemoveRows();
-
- // there have not been any additions, but without the following line marble seems to crash here.
- emit dataChanged( index( 0, 0 ), index( 0, 0 ) );
+ emit layoutChanged();
qDebug() << "removePlacemarks(" << containerName << "): Time elapsed:" << t.elapsed() << "ms for" << length << "Placemarks.";
}
More information about the Marble-commits
mailing list