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

List:       kde-commits
Subject:    [marble] /: don't copy GeoDataObject part of features
From:       Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date:       2014-09-29 19:26:04
Message-ID: E1XYgaC-00060e-H0 () scm ! kde ! org
[Download RAW message or body]

Git commit b2cd9e64d53f7f213d0b2959ca8da7ae704d1506 by Bernhard Beschow.
Committed on 27/09/2014 at 16:47.
Pushed by beschow into branch 'master'.

don't copy GeoDataObject part of features

BUG: 339443

M  +1    -3    src/lib/marble/geodata/data/GeoDataFeature.cpp
M  +1    -1    src/lib/marble/geodata/data/GeoDataPlacemark.cpp
M  +0    -2    tests/TestGeoDataCopy.cpp

http://commits.kde.org/marble/b2cd9e64d53f7f213d0b2959ca8da7ae704d1506

diff --git a/src/lib/marble/geodata/data/GeoDataFeature.cpp \
b/src/lib/marble/geodata/data/GeoDataFeature.cpp index 1a0d86d..6f330fb 100644
--- a/src/lib/marble/geodata/data/GeoDataFeature.cpp
+++ b/src/lib/marble/geodata/data/GeoDataFeature.cpp
@@ -46,7 +46,7 @@ GeoDataFeature::GeoDataFeature()
 }
 
 GeoDataFeature::GeoDataFeature( const GeoDataFeature& other )
-    : GeoDataObject( other ),
+    : GeoDataObject(),
       d( other.d )
 {
     d->ref.ref();
@@ -79,8 +79,6 @@ GeoDataFeaturePrivate* GeoDataFeature::p() const
 
 GeoDataFeature& GeoDataFeature::operator=( const GeoDataFeature& other )
 {
-    GeoDataObject::operator=( other );
-    
     if (!d->ref.deref()) {
         delete d;
     }
diff --git a/src/lib/marble/geodata/data/GeoDataPlacemark.cpp \
b/src/lib/marble/geodata/data/GeoDataPlacemark.cpp index a665aad..7af4f9a 100644
--- a/src/lib/marble/geodata/data/GeoDataPlacemark.cpp
+++ b/src/lib/marble/geodata/data/GeoDataPlacemark.cpp
@@ -59,7 +59,7 @@ GeoDataPlacemark::~GeoDataPlacemark()
 
 GeoDataPlacemark &GeoDataPlacemark::operator=( const GeoDataPlacemark &other )
 {
-    *p() = *other.p();
+    GeoDataFeature::operator=( other );
 
     return *this;
 }
diff --git a/tests/TestGeoDataCopy.cpp b/tests/TestGeoDataCopy.cpp
index 815a010..c354d8f 100644
--- a/tests/TestGeoDataCopy.cpp
+++ b/tests/TestGeoDataCopy.cpp
@@ -437,9 +437,7 @@ void TestGeoDataCopy::copyPlacemark()
     {
         GeoDataPlacemark other(placemark);
 
-        QEXPECT_FAIL("", "an ID is unique in the context of a document, so shouldn't \
be copied", Continue);  QCOMPARE(other.id(), QString());
-        QEXPECT_FAIL("", "similar case like for ID, so shouldn't be copied", \
Continue);  QCOMPARE(other.parent(), static_cast<GeoDataObject *>(0));
         testCoordinate(other.coordinate(), 123.4, 2, coordString[0]);
         testCoordinate(static_cast<GeoDataPoint*>(other.geometry())->coordinates(), \
123.4, 2, coordString[0]);


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

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