Bug 334286 - Equality operators for Container, Folder and Document
Summary: Equality operators for Container, Folder and Document
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 1.7 (KDE 4.12)
Platform: unspecified Linux
: NOR task
Target Milestone: ---
Assignee: Cruceru Calin-Cristian
URL:
Keywords: junior-jobs
Depends on: 334285
Blocks: 334289
  Show dependency treegraph
 
Reported: 2014-05-03 16:18 UTC by Dennis Nienhüser
Modified: 2014-05-06 18:25 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Nienhüser 2014-05-03 16:18:25 UTC
Override the equals() method in GeoDataContainer. Have it iterate over m_vector and check each feature for equality by downcasting it to possible children based on the nodeType(). Possible children are GeoDataDocument, GeoDataFolder, GeoDataNetworkLinkControl, GeoDataNetworkLink, GeoDataGroundOverlay, GeoDataPhotoOverlay, GeoDataScreenOverlay, GeoDataPlacemark and GeoDataTour, see http://api.kde.org/4.x-api/kdeedu-apidocs/marble/html/classMarble_1_1GeoDataFeature.html

Add operator== and operator!= to GeoDataFolder and GeoDataDocument. For GeoDataFolder it only needs to return the result of equals() of its parent GeoDataContainer. For GeoDataDocument additionally the other members need to be checked.

Extend TestEquality for new unit test methods for GeoDataFolder (no need for a GeoDataDocument unit test in this task). Make sure to compile Marble with the BUILD_MARBLE_TESTS=TRUE option enabled and run the test case from the build folder (run tests/TestEquality). Submit a review request at https://git.reviewboard.kde.org.

Please leave a comment here (e.g. "I want to work on this task.") if you start working on this task to avoid multiple people working on it at the same time.
Comment 1 Cruceru Calin-Cristian 2014-05-04 11:42:35 UTC
Since I finished working on the last two tasks for equality operators in container classes, I would like to continue working on this task if everyone is ok with that. I have a good amount of free time these days and a great programming mood :).
Comment 2 Dennis Nienhüser 2014-05-04 12:41:43 UTC
I say yes on behalf of everyone :-)
Comment 3 Cruceru Calin-Cristian 2014-05-06 18:25:56 UTC
Git commit 62a88c28a70478196ad8600cf28200d0dc7d3f2a by Cruceru Calin-Cristian.
Committed on 06/05/2014 at 18:24.
Pushed by crucerucalincristian into branch 'master'.

Equality operators for Container, Folder and Document
REVIEW: 118010

M  +102  -0    src/lib/marble/geodata/data/GeoDataContainer.cpp
M  +3    -0    src/lib/marble/geodata/data/GeoDataContainer.h
M  +18   -0    src/lib/marble/geodata/data/GeoDataDocument.cpp
M  +3    -0    src/lib/marble/geodata/data/GeoDataDocument.h
M  +10   -0    src/lib/marble/geodata/data/GeoDataFolder.cpp
M  +3    -0    src/lib/marble/geodata/data/GeoDataFolder.h
M  +1    -1    src/lib/marble/geodata/data/GeoDataNetworkLinkControl.cpp
M  +75   -0    tests/TestEquality.cpp

http://commits.kde.org/marble/62a88c28a70478196ad8600cf28200d0dc7d3f2a