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

List:       kopete-devel
Subject:    [Kopete-devel] [Bug 73108] kopete crashes when deleting a folder
From:       Richard Smith <kde () metafoo ! co ! uk>
Date:       2004-02-29 16:08:24
Message-ID: 20040229160824.22151.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=73108      




------- Additional Comments From kde metafoo co uk  2004-02-29 17:08 -------
On Sunday 29 February 2004 3:11 pm, Martijn Klingens wrote:
> Hmm, the real bug is obviously an API flaw, since the group can't be
> deleted yet if there are still contacts in it.
>
> Would Richard's new async Kopete::Task API help in solving this properly?

I'd imagine so. The way I'd see this working is as follows:

Kopete::ContactList::removeGroup() is called. It creates and returns a 
RemoveGroupTask. The RemoveGroupTask unregisters the group somehow so new 
metacontacts can't get added to it while it's working, and then calls 
KopeteMetaContact::removeFromGroup() on each of the metacontacts in the 
group. They return their own Tasks for performing that job. When all the 
RemoveGroupTask's subtasks have completed, it removes the group and emits the 
result() signal.

KopeteMetaContact::removeFromGroup returns a Task which removes all contacts 
from the group (asynchronously if the protocol wants to), and then, if the 
metacontact is now in no groups, deletes the metacontact or sets it to be 
temporary (picking one based on a flag passed to removeFromGroup() [1]). 
Again the metacontact should probably be flagged somehow so new contacts 
can't be added to it while this is going on.

Richard

--
[1] Alternatively, we can make KMCs reference counted. Then they can be 
deleted if they're removed from the last group and no-one else has a 
reference to them, otherwise they become temporary metacontacts. This seems 
to me to be a nice way of fixing the inconsistency when you delete from your 
contact list someone who you're in a chat to.
_______________________________________________
Kopete-devel mailing list
Kopete-devel@kde.org
https://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