[Kde-pim] Review Request: Type safe assignment of incidence pointers

Kevin Krammer kevin.krammer at gmx.at
Thu Feb 12 12:58:23 GMT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/51/
-----------------------------------------------------------

(Updated 2009-02-12 04:58:23.081854)


Review request for KDE PIM.


Changes
-------

Moved the visitor to kdepimlibs/kcal


Summary
-------

As discovered by David Jarvie, some code parts try to update an incidence with another through assignment, however this will only invoke the assignment operator of the common base class.

The following patch adds a helper class which determines the subclass of one pointer through the visitor pattern and then tries to dynamic_cast the other. If this works the assignment is delegated to the subclass' operator=(), otherwise the operation aborts.

Patch contains helper class, respective unittest and changes to ICal resource and KCal resource bridge


Diffs (updated)
-----

  /trunk/KDE/kdepim/akonadi/resources/ical/icalresource.h 925081 
  /trunk/KDE/kdepim/akonadi/resources/ical/icalresource.cpp 925081 
  /trunk/KDE/kdepim/kresources/akonadi/kcal/resourceakonadi.cpp 925081 
  /trunk/KDE/kdepimlibs/kcal/CMakeLists.txt 925081 
  /trunk/KDE/kdepimlibs/kcal/assignmentvisitor.h PRE-CREATION 
  /trunk/KDE/kdepimlibs/kcal/assignmentvisitor.cpp PRE-CREATION 
  /trunk/KDE/kdepimlibs/kcal/tests/CMakeLists.txt 925081 
  /trunk/KDE/kdepimlibs/kcal/tests/testassignmentvisitor.cpp PRE-CREATION 

Diff: http://reviewboard.kde.org/r/51/diff


Testing
-------


Thanks,

Kevin

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list