[Marble-commits] KDE/kdeedu/marble

Thibaut Gridel tgridel at free.fr
Fri Jul 16 23:10:39 CEST 2010


SVN commit 1150822 by tgridel:

ReviewBoard comments

Thanks: bholst

 M  +27 -27    src/lib/GeoDataTreeModel.cpp  
 M  +1 -1      src/lib/GeoDataTreeModel.h  
 M  +1 -1      src/lib/geodata/data/GeoDataFolder.h  
 M  +1 -1      src/lib/geodata/data/GeoDataPlacemark.h  
 M  +3 -5      src/plugins/render/geodata/GeoRendererView.cpp  
 M  +0 -3      tests/TestGeoData.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/GeoDataTreeModel.cpp #1150821:1150822
@@ -13,7 +13,6 @@
 #include "GeoDataTreeModel.h"
 
 // Qt
-#include <QtCore/QDebug>
 #include <QtCore/QModelIndex>
 #include <QtCore/QFile>
 #include <QtGui/QPixmap>
@@ -26,6 +25,7 @@
 #include "GeoDataTypes.h"
 #include "FileManager.h"
 #include "KmlFileViewItem.h"
+#include "MarbleDebug.h"
 
 using namespace Marble;
 
@@ -49,22 +49,22 @@
 
 int GeoDataTreeModel::rowCount( const QModelIndex &parent ) const
 {
-//    qDebug() << "rowCount";
+//    mDebug() << "rowCount";
     GeoDataObject *parentItem;
     if ( parent.column() > 0 ) {
-//        qDebug() << "rowCount bad column";
+//        mDebug() << "rowCount bad column";
         return 0;
     }
 
     if ( !parent.isValid() ) {
-//        qDebug() << "rowCount root parent";
+//        mDebug() << "rowCount root parent";
         parentItem = d->m_rootDocument;
     } else {
         parentItem = static_cast<GeoDataObject*>( parent.internalPointer() );
     }
 
     if ( !parentItem ) {
-//        qDebug() << "rowCount bad parent";
+//        mDebug() << "rowCount bad parent";
         return 0;
     }
 
@@ -74,10 +74,10 @@
         || type == GeoDataTypes::GeoDataFolderType ) {
         GeoDataContainer *container = static_cast<GeoDataContainer*>( parentItem );
         if ( container ) {
-//            qDebug() << "rowCount " << type << "(" << parentItem << ") =" << container->size();
+//            mDebug() << "rowCount " << type << "(" << parentItem << ") =" << container->size();
             return container->size();
         } else {
-//            qDebug() << "rowCount bad container " << container;
+//            mDebug() << "rowCount bad container " << container;
         }
     }
 
@@ -85,10 +85,10 @@
         GeoDataPlacemark *placemark = static_cast<GeoDataPlacemark*>( parentItem );
         if ( placemark ) {
             if ( placemark->geometry() ) {
-//                qDebug() << "rowCount " << type << "(" << parentItem << ") = 1";
+//                mDebug() << "rowCount " << type << "(" << parentItem << ") = 1";
                 return 1;
             }
-//            qDebug() << "rowCount " << type << "(" << parentItem << ") = 0";
+//            mDebug() << "rowCount " << type << "(" << parentItem << ") = 0";
             return 0;
         }
     }
@@ -96,21 +96,21 @@
     if ( type == GeoDataTypes::GeoDataMultiGeometryType ) {
         GeoDataMultiGeometry *geometry = static_cast<GeoDataMultiGeometry*>( parentItem );
         if ( geometry ) {
-//            qDebug() << "rowCount " << parent << " " << type << " " << geometry->size();
+//            mDebug() << "rowCount " << parent << " " << type << " " << geometry->size();
             return geometry->size();
         } else {
-//            qDebug() << "rowCount bad geometry " << geometry;
+//            mDebug() << "rowCount bad geometry " << geometry;
         }
     }
 
-//    qDebug() << "rowcount end";
+//    mDebug() << "rowcount end";
     return 0;//parentItem->childCount();
 }
 
 
 QVariant GeoDataTreeModel::data( const QModelIndex &index, int role ) const
 {
-//    qDebug() << "data";
+//    mDebug() << "data";
     if ( !index.isValid() )
         return QVariant();
 
@@ -134,9 +134,9 @@
 
 QModelIndex GeoDataTreeModel::index( int row, int column, const QModelIndex &parent )             const
 {
-//    qDebug() << "index";
+//    mDebug() << "index";
     if ( !hasIndex( row, column, parent ) ) {
-//        qDebug() << "index bad index";
+//        mDebug() << "index bad index";
         return QModelIndex();
     }
     
@@ -148,7 +148,7 @@
         parentItem = static_cast<GeoDataObject*>( parent.internalPointer() );
 
     if ( !parentItem ) {
-//        qDebug() << "index bad parent";
+//        mDebug() << "index bad parent";
         return QModelIndex();
     }
 
@@ -184,7 +184,7 @@
 
 
     if ( childItem ) {
-//        qDebug() << "index " << type << "[" << row << "](" << parentItem << ") ="
+//        mDebug() << "index " << type << "[" << row << "](" << parentItem << ") ="
 //                << childItem->nodeType() << "(" << childItem << ")";
         return createIndex( row, column, childItem );
     }
@@ -193,9 +193,9 @@
 
 QModelIndex GeoDataTreeModel::parent( const QModelIndex &index ) const
 {
-//    qDebug() << "parent";
+//    mDebug() << "parent";
     if ( !index.isValid() ) {
-//        qDebug() << "parent bad index";
+//        mDebug() << "parent bad index";
         return QModelIndex();
     }
 
@@ -219,14 +219,14 @@
              || greatParentType == GeoDataTypes::GeoDataFolderType ) {
             GeoDataFeature *parentFeature = static_cast<GeoDataFeature*>( parentObject );
             GeoDataContainer * greatparentContainer = static_cast<GeoDataContainer*>( greatParentObject );
-//            qDebug() << "parent " << childObject->nodeType() << "(" << childObject << ") = "
+//            mDebug() << "parent " << childObject->nodeType() << "(" << childObject << ") = "
 //                    << parentObject->nodeType() << "[" << greatparentContainer->childPosition( parentFeature ) << "](" << parentObject << ")";
             return createIndex( greatparentContainer->childPosition( parentFeature ), 0, parentObject );
         }
 
         // greatParent can be a placemark
         if ( greatParentType == GeoDataTypes::GeoDataPlacemarkType ) {
-//                qDebug() << "parent " << childObject->nodeType() << "(" << childObject << ") = "
+//                mDebug() << "parent " << childObject->nodeType() << "(" << childObject << ") = "
 //                        << parentObject->nodeType() << "[0](" << parentObject << ")";
             return createIndex( 0, 0, parentObject );
         }
@@ -235,25 +235,25 @@
         if ( greatParentType == GeoDataTypes::GeoDataMultiGeometryType ) {
             GeoDataGeometry *parentGeometry = static_cast<GeoDataGeometry*>( parentObject );
             GeoDataMultiGeometry * greatParentItem = static_cast<GeoDataMultiGeometry*>( greatParentObject );
-//                qDebug() << "parent " << childObject->nodeType() << "(" << childObject << ") = "
+//                mDebug() << "parent " << childObject->nodeType() << "(" << childObject << ") = "
 //                        << parentObject->nodeType() << "[" << greatParentItem->childPosition( parentGeometry ) << "](" << parentObject << ")";
             return createIndex( greatParentItem->childPosition( parentGeometry ), 0, parentObject );
         }
 
     }
 
-//    qDebug() << "parent unknown index";
+//    mDebug() << "parent unknown index";
     return QModelIndex();
 }
 
 int GeoDataTreeModel::columnCount( const QModelIndex &node ) const
 {
-//    qDebug() << "columncount";
+//    mDebug() << "columncount";
     if ( node.isValid() ) {
-//        qDebug() << "columncount valid";
+//        mDebug() << "columncount valid";
         return 1;
     } else {
-//        qDebug() << "columncount invalid";
+//        mDebug() << "columncount invalid";
         return 1;
     }
 }
@@ -288,7 +288,7 @@
 
 void GeoDataTreeModel::update()
 {
-//    qDebug() << "updating GeoDataTreeModel";
+//    mDebug() << "updating GeoDataTreeModel";
     reset();
 }
 
--- trunk/KDE/kdeedu/marble/src/lib/GeoDataTreeModel.h #1150821:1150822
@@ -30,7 +30,7 @@
  public:
 
     /**
-     * Creates a new GeoDataModel.
+     * Creates a new GeoDataTreeModel.
      *
      * @param parent The parent object.
      */
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataFolder.h #1150821:1150822
@@ -58,7 +58,7 @@
     /// Provides type information for downcasting a GeoData
     virtual QString nodeType() const;
 
-//private:
+ private:
     GeoDataFolderPrivate *p() const;
 };
 
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataPlacemark.h #1150821:1150822
@@ -187,7 +187,7 @@
      */
     virtual void unpack( QDataStream& stream );
 
-// private:
+ private:
     GeoDataPlacemarkPrivate *p() const;
 };
 
--- trunk/KDE/kdeedu/marble/src/plugins/render/geodata/GeoRendererView.cpp #1150821:1150822
@@ -103,13 +103,11 @@
      * then call the real render function. For the rest iterate through the
      * children and recurse.
      */
-    if (index.isValid())
-    {
+    if ( index.isValid() ) {
         GeoDataObject* indexObject = static_cast<GeoDataObject*>(index.internalPointer());
-        if (indexObject->nodeType() == GeoDataTypes::GeoDataDocumentType) {
+        if ( dynamic_cast<GeoDataDocument*>( indexObject ) ) {
             m_root = static_cast<GeoDataDocument*>(indexObject);
-            if (!m_root->isVisible())
-            {
+            if ( !m_root->isVisible() ) {
                 return;
             }
         }
--- trunk/KDE/kdeedu/marble/tests/TestGeoData.cpp #1150821:1150822
@@ -96,7 +96,6 @@
     GeoDataPlacemark *placemarkPtr;
     QCOMPARE(document->child(0)->nodeType(), placemark->nodeType());
     placemarkPtr = static_cast<GeoDataPlacemark*>(document->child(0));
-    QCOMPARE(placemarkPtr->p(), placemark->p());
     QCOMPARE(placemarkPtr, placemark);
 
     /// check retrieved placemark matches intented child
@@ -107,7 +106,6 @@
     GeoDataFolder *folderPtr;
     QCOMPARE(document->child(1)->nodeType(), folder->nodeType());
     folderPtr = static_cast<GeoDataFolder*>(document->child(1));
-    QCOMPARE(folderPtr->p(), folder->p());
     QCOMPARE(folderPtr, folder);
 
     /// check retrieved folder matches intended child
@@ -118,7 +116,6 @@
     QCOMPARE(folderPtr->size(), 1);
     placemarkPtr = static_cast<GeoDataPlacemark*>(folderPtr->child(0));
     QCOMPARE(placemarkPtr->nodeType(), placemark2->nodeType());
-    QCOMPARE(placemarkPtr->p(), placemark2->p());
     QCOMPARE(placemarkPtr, placemark2);
 
 


More information about the Marble-commits mailing list