[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-05 15:54:18
[Download RAW message or body]

On Sunday 05 May 2002 17:29, Martijn Klingens wrote:
>
> Well... I *thought* it was possible to do the following:
>
> QPtrList<QObject> list;
> QObject *obj = new QOject;
> list = obj;

oh, i see. i didn't know about these. well, if it's indeed the case, please 
remove them. in the meantime, just leave them (i tend to trust the qt docs 
:-), until we hear from Daniel.

> Well, what's wrong with explicitly doing emit sent() instead of wrapping it
> in a one-liner method? That's what seemed redundant to me...

here's the flow:
 - message gets sent by the protocol, we're executing code inside the 
KopeteProtocol subclass.
 - we now should notify the KMM. if we then say "emit blabla", the signal will 
effectively be emitted by the protocol, not the message (with the 
afformentioned problems this yields). the emit has to come from inside 
KopeteMessage code.

> signal KopeteProtocol::messageSent( const KopeteMessage *msg,
>     const KopeteMessageManager *mgr );
>
> maybe? The slot then starts with
>
> if( mgr != this )
>      return;

of course, this works. but it remains that all the KMMs will receive the 
notification (i think this is a bad thing, doesn't scale well). it's the same 
as the contacts before using QMaps.... all of them received new messages even 
ones that weren't for them. and the code started with a if(mName != name) 
return;.

> But after the message is actually sent the KMM can still call setRead( true
> ), no? It doesn't have to be done before the data is sent, but that doesn't
> mean setRead() is a useless method either. Or am I missing a point?

i think i'm the one who doesn't understand now... what i did was the 
following:
 - inside the KMM:
  * create message
  * emit messageSent 
 - inside the protocol:
  * send the message
  * message::setRead(true);
 - then we return from the emit messageSent, inside the KMM
  * check if read() was true
  * if so, show it in the chatwindow
  (* if not, print an error message)

the problem with this scheme is that it's synchronous, not good.
now i believe your use of setRead() is different from mine, and i don't 
understand it :-)
would you please explain further ?

thanks,

-- 
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