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

List:       kde-commits
Subject:    Re: kroupware_branch: kdepim/libkcal
From:       Holger Freyther <freyther () gmx ! net>
Date:       2003-01-31 19:22:36
[Download RAW message or body]

On Friday 31 January 2003 10:06, Bo Thorsen wrote:
> CVS commit by thorsen:
>
> If Incidence has an operator=, so should Event
This makes libkcal even more non obvious.
Either use type() and clone() or a ValueBased copy c'tor, assignment operator 
design but please do not mix both concepts.
You will end up with ptr's showing nowhere, suffering slicing.... and a lot 
more

regards Holger
>
>
>   M +10 -0     event.cpp   1.11.2.2
>   M +3 -1      event.h   1.12.2.2
>
>
> --- kdepim/libkcal/event.cpp  #1.11.2.1:1.11.2.2
> @@ -49,4 +49,14 @@ Event *Event::clone()
>  }
>
> +
> +Event& Event::operator=( const Event& e )
> +{
> +  if( this == &e ) return *this;
> +  Incidence::operator=(e);
> +  mDtEnd = e.mDtEnd;
> +  mHasEndDate = e.mHasEndDate;
> +  mTransparency = e.mTransparency;
> +}
> +
>  bool KCal::operator==( const Event& e1, const Event& e2 )
>  {
>
> --- kdepim/libkcal/event.h  #1.12.2.1:1.12.2.2
> @@ -39,5 +39,5 @@ class Event : public Incidence
>      ~Event();
>
> -    QCString type() const { return "Event"; }
> +    virtual QCString type() const { return "Event"; }
it's already virtual you do not need to mark it as virtual here...
>
>      Event *clone();
> @@ -68,4 +68,6 @@ class Event : public Incidence
>
>      void setDuration(int seconds);
> +
> +    Event& operator=( const Event& i );
>
>    private:

-- 
_____________________________________________
Holger 'zecke' Freyther
developer
Project OPIE- the Open Palmtop Integrated Environment
http://opie.handhelds.org | http://www.opie.info (german)
IRC: irc.freenode.net #opie #opie.de
[prev in list] [next in list] [prev in thread] [next in thread] 

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