From kde-commits Mon Dec 31 22:22:26 2007 From: Torsten Rahn Date: Mon, 31 Dec 2007 22:22:26 +0000 To: kde-commits Subject: KDE/kdeedu/marble Message-Id: <1199139746.146407.30359.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=119913975420522 SVN commit 755274 by rahn: - Fixing a crash reported by Claudiu Costin. M +8 -0 ChangeLog M +2 -0 src/lib/MarbleModel.cpp M +5 -2 src/lib/PlaceMarkLayout.cpp M +1 -1 src/lib/PlaceMarkLayout.h M +7 -1 src/lib/VisiblePlaceMark.cpp --- trunk/KDE/kdeedu/marble/ChangeLog #755273:755274 @@ -1,3 +1,11 @@ +2007-12-31 Torsten Rahn + + * src/lib/PlaceMarkLayout.{cpp,h}: + * src/lib/MarbleModel.cpp: + * src/lib/VisiblePlaceMark.cpp: + + - Fixing a crash reported by Claudiu Costin. + 2007-12-31 Inge Wallin * src/ControlView.h (marbleControl): New function --- trunk/KDE/kdeedu/marble/src/lib/MarbleModel.cpp #755273:755274 @@ -124,6 +124,8 @@ connect( d->m_placemarkselectionmodel, SIGNAL( selectionChanged ( QItemSelection, QItemSelection) ), d->m_placeMarkLayout, SLOT( requestStyleReset() ) ); + connect( d->m_placemarkmodel, SIGNAL( modelReset() ), + d->m_placeMarkLayout, SLOT( requestStyleReset() ) ); d->m_placemarkmanager->loadStandardPlaceMarks(); --- trunk/KDE/kdeedu/marble/src/lib/PlaceMarkLayout.cpp #755273:755274 @@ -108,13 +108,16 @@ void PlaceMarkLayout::styleReset() { m_paintOrder.clear(); - qDeleteAll( m_visiblePlaceMarks ); m_visiblePlaceMarks.clear(); } -QVector PlaceMarkLayout::whichPlaceMarkAt( const QPoint& curpos ) const +QVector PlaceMarkLayout::whichPlaceMarkAt( const QPoint& curpos ) { + if ( m_styleResetRequested == true ) { + styleReset(); + } + QVector ret; QVector::const_iterator it; --- trunk/KDE/kdeedu/marble/src/lib/PlaceMarkLayout.h #755273:755274 @@ -86,7 +86,7 @@ /** * Returns a list of model indexes that are at position @p pos. */ - QVector whichPlaceMarkAt( const QPoint &pos ) const; + QVector whichPlaceMarkAt( const QPoint &pos ); PlaceMarkPainter* placeMarkPainter() const; --- trunk/KDE/kdeedu/marble/src/lib/VisiblePlaceMark.cpp #755273:755274 @@ -44,7 +44,13 @@ const QPixmap& VisiblePlaceMark::symbolPixmap() const { - GeoDataStyle* style = m_modelIndex.data( MarblePlacemarkModel::StyleRole ).value(); + GeoDataStyle* style = ( ( MarblePlacemarkModel* )m_modelIndex.model() )->styleData( m_modelIndex ); +// GeoDataStyle* style = m_modelIndex.data( MarblePlacemarkModel::StyleRole ).value(); + if ( style == 0 ) + { + qDebug() << "Style pointer null"; + return QPixmap(); + } m_symbolPixmap = style->iconStyle()->icon(); return m_symbolPixmap; }