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

List:       kopete-devel
Subject:    Re: [Kopete-devel] patch, and other stuff
From:       Andres Krapf <dae () chez ! com>
Date:       2002-05-04 16:28:55
[Download RAW message or body]

On Saturday 04 May 2002 15:05, Martijn Klingens wrote:
> 2. Why a copy constructor for KopeteMessage? It's a simple data object, and
> the compiler will by default already make the required deep copy. I don't
> see a reason to make the copy c'tor explicit, but I may have missed
> something.

yup... if i don't provide one, the default will be a deep copy, + call to the 
base class, aka QObject's copy ctor. and QObject(const QObject&) is private.. 
probably because we shouldn't do QObject copy constructions.

if i dig more into the underlying problem, it's probably the signal mechanism 
which wasn't designed to by copied from object to object (should it connect 
the new object with the older signals/slots ? or not ?)

following this logic, i should make KopeteMessage's copy ctor private, and not 
use it.

the problem is that KMM uses a copy of the message (right now it's hidden 
inside QValueList, but it's a copy nonetheless), and therefore needs to copy 
it somehow.

since we only needed the data (as you say, the KM is basically a data 
structure) i didn't care much for the underlying signal/slot stuff. so what 
should be done then? any ideas, somebody ?

we could:
 /1 split KM in a structural part and a qobject part (and document the fact 
that signal/slots don't get transmitted with copies, only the data). this 
would be the same as now, although with better defined behaviour.
 /2 use a "new KopeteMessage()" instead of a "KopeteMessage()" inside the 
plugins, so the KMM doesn't need to copy it. this is most efficient, but as 
far as design goes, i'm not sure... although i like it better.

go ahead, i want your opinions :-)

cheers,

-- 
Andres
_______________________________________________
Kopete-devel mailing list
Kopete-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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