Bug 147602 - Incidence::removeRelation does nothing, really
Summary: Incidence::removeRelation does nothing, really
Status: RESOLVED FIXED
Alias: None
Product: kontact
Classification: Applications
Component: calendar (show other bugs)
Version: CVS
Platform: Compiled Sources Linux
: NOR normal with 20 votes (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-06 11:24 UTC by Thorsten Staerk
Modified: 2007-07-14 15:07 UTC (History)
0 users

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 Thorsten Staerk 2007-07-06 11:24:55 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

When calling Incidence::removeRelation, nothing seems to happen. I wrote a test case for this:

/* test case for Incidence::removeRelation
(c) 2007 by Thorsten Staerk
This test case associates a todo with another, removes this relation
and shows if the removal was successful.
Compile it like this:
g++ -I/opt/kde3/include -I/usr/lib/qt3/include -lqt-mt -L/usr/lib/qt3/lib -lkcal -L/opt/kde3/lib main.cpp
*/

#include <libkcal/todo.h>
#include <kdebug.h>

class KCal::Incidence;

int main()
{
  KCal::Todo* i=new KCal::Todo();
  KCal::Todo* b=new KCal::Todo();
  b->setRelatedTo(i);
  kdDebug() << "b is now related to " << b->relatedTo() << endl;
  b->removeRelation(i);
  kdDebug() << "I expect the following to be empty: " << b->relatedTo() << endl;
}

b->relatedTo stays something even after b->removeRelation.
Comment 1 Thorsten Staerk 2007-07-06 11:26:58 UTC
I fixed this for trunk, see http://websvn.kde.org/trunk/KDE/kdepimlibs/kcal/incidence.cpp?r1=663415&r2=675345
Comment 2 Thomas McGuire 2007-07-09 18:42:14 UTC
>I fixed this for trunk
Excellent. Can you backport that to 3.5 branch as well?
Or should someone else do that? (probably the KCal maintainer, whoever that is)
Comment 3 Thorsten Staerk 2007-07-10 10:01:08 UTC
I can backport it to trunk, I just wanted to have a "go ahead" from someone.
Thanks.
Comment 4 Thorsten Staerk 2007-07-14 15:07:16 UTC
SVN commit 687820 by tstaerk:

Really remove relatedUids.
BUGS:147602

--This linie, and those below, will be ignored--

M    libkcal/incidence.cpp


 M  +3 -0      incidence.cpp  


--- branches/KDE/3.5/kdepim/libkcal/incidence.cpp #687819:687820
@@ -321,9 +321,12 @@
 }
 
 void Incidence::removeRelation(Incidence *event)
+// Remove the relation of our incident. E.g. if you have a task t and a
+// subtask, the subtask will have its relation to the task t.
 {
   mRelations.removeRef(event);
 //  if (event->getRelatedTo() == this) event->setRelatedTo(0);
+  mRelatedToUid=QString();
 }