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

List:       kde-commits
Subject:    KDE/kdeedu/marble
From:       Torsten Rahn <tackat () kde ! org>
Date:       2007-12-31 22:22:26
Message-ID: 1199139746.146407.30359.nullmailer () svn ! kde ! org
[Download RAW message or body]

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  <rahn@kde.org>
+
+    * 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  <inge@lysator.liu.se>
 
 	* 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<QPersistentModelIndex> PlaceMarkLayout::whichPlaceMarkAt( const QPoint& curpos ) const
+QVector<QPersistentModelIndex> PlaceMarkLayout::whichPlaceMarkAt( const QPoint& curpos )
 {
+    if ( m_styleResetRequested == true ) {
+        styleReset();
+    }
+
     QVector<QPersistentModelIndex> ret;
 
     QVector<VisiblePlaceMark*>::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<QPersistentModelIndex> whichPlaceMarkAt( const QPoint &pos ) const;
+    QVector<QPersistentModelIndex> 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*>();
+    GeoDataStyle* style = ( ( MarblePlacemarkModel* )m_modelIndex.model() )->styleData( m_modelIndex );
+//    GeoDataStyle* style = m_modelIndex.data( MarblePlacemarkModel::StyleRole ).value<GeoDataStyle*>();
+    if ( style == 0 )
+    {
+        qDebug() << "Style pointer null";
+        return QPixmap();
+    }
     m_symbolPixmap = style->iconStyle()->icon(); 
     return  m_symbolPixmap;
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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