Version: 0.9.1 (using KDE KDE 3.3.1) Installed from: Gentoo Packages Compiler: gcc 3.3.4 OS: Linux A friend came home and had to connect to his msn accound so I set up a new account for him. Everythings worked fine. But when I deleted his msn account, all of his contacts are still in my contact list. Annoying. There are more than 100 contacts :( If I could sort the contact by account, it would be easy to delete the group. Contacts belonging to one account should be deleted when the account is deleted.
we don't do this, and i think we should, just in the interest of contact list cleanliness
I really think you guys should. Was just about to request this myself. Kopete takes ages to load initially, because it has to load so many contacts (which are never being put to use... just people who logged on once or twice).
Ok, but could you please add a function to manually do this ? It's really annoying, and nearly impossible by hand. The hability to sort the contact list by account would do the stuff as we could then delete the group.
This should be changed to a "bug" rather than a wish, since it [can] seriously hinder functionality. For example, whenever I have friends around they want to log on some time, and so it brings in all their contacts. Consequently Kopete takes almost over a minute to fully start up now. There's also around a zillion offline contacts which I really wouldn't want to appear there. I'd delete my contactlist.xml and just start fresh, but I've recently started giving aliases to my contacts, which I imagine would all be deleted if I removed that file. Would be pretty annoying to put those back in again.
*** Bug 121317 has been marked as a duplicate of this bug. ***
Would like to also see this implemented. Easy way to delete unused people and protocols.
yeah, like your niece is visiting your home and she wants to connect to MSN one time. she use your kopete and bang you got all her contact list. of course you could have created her own unix account. but only for one time ?
I tried making a little hacky script to clean it up, using the rule of "if a metacontact doesn't contain anything to do with "<plugin-data" then it must belong to a deleted account" http://people.pwf.cam.ac.uk/dl325/media/text/kopetexmlclean.py I no longer have any empty contacts, but there's no noticeable improvement in start-up time. Even $ mv kopete_statistics-0.1.db kopete_statistics-0.1.db.`date %s` didn't make things much better. Does anyone have a nice tutorial on how to use a profiler with Kopete, or should I simply leave Kopete open constantly, so startup time doesn't pose such a problem? Note: there's also a work-around (suggested in Bug 112429 ) which sounds like a neat little hack for *all* your temporary-KDE-sharing needs: > ------- Additional Comment #1 From Olivier Goffart 2005-09-11 16:12 ------- >try also > > mkdir ~/.kde_guest > export KDEHOME=~/.kde_guest > kopete --nofork > > That will run another kopete, with a new config saved in ~/.kde_guest instead >of ~/.kde > > Is that a decent solution ?
Same here. After deleting the one-and-only icq account used with kopete, I expected an empty contacts list. Instead, it was still cluttered with all the contacts (but empty names). Suggestion: If an account is deleted, ask whether its contacts should be deleted as well.
SVN commit 552390 by mattr: Fix bug 94057. Contacts and groups for the account are now deleted from the contact list when the account is removed. BUG: 94057 M +33 -9 kopeteaccountmanager.cpp --- branches/kopete/0.12/kopete/libkopete/kopeteaccountmanager.cpp #552389:552390 @@ -31,9 +31,12 @@ #include "kopeteaway.h" #include "kopeteprotocol.h" #include "kopetecontact.h" +#include "kopetecontactlist.h" #include "kopetepluginmanager.h" #include "kopeteonlinestatus.h" #include "kopeteonlinestatusmanager.h" +#include "kopetemetacontact.h" +#include "kopetegroup.h" namespace Kopete { @@ -48,7 +51,7 @@ { uint priority1 = static_cast<Account*>(a)->priority(); uint priority2 = static_cast<Account*>(b)->priority(); - + if( a==b ) //two account are equal only if they are equal :-) return 0; // remember than an account can be only once on the list, but two account may have the same priority when loading else if( priority1 > priority2 ) @@ -114,7 +117,7 @@ if ( it.current()->isConnected() ) it.current()->setAway( false, awayReason ); } - else + else if(!it.current()->excludeConnect()) it.current()->connect(); } @@ -153,7 +156,7 @@ { OnlineStatusManager::Categories katgor=(OnlineStatusManager::Categories)category; bool anyConnected = isAnyAccountConnected(); - + for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it ) { Account *account = it.current(); @@ -219,7 +222,7 @@ { if( !account || d->accounts.contains( account ) ) return account; - + if( account->accountId().isEmpty() ) { account->deleteLater(); @@ -236,9 +239,9 @@ } } - d->accounts.append( account ); + d->accounts.append( account ); d->accounts.sort(); - + // Connect to the account's status changed signal connect(account->myself(), SIGNAL(onlineStatusChanged(Kopete::Contact *, const Kopete::OnlineStatus &, const Kopete::OnlineStatus &)), @@ -295,6 +298,27 @@ KConfigGroup *configgroup = account->configGroup(); + // Clean up the contact list + QDictIterator<Kopete::Contact> it( account->contacts() ); + for ( ; it.current(); ++it ) + { + Contact* c = it.current(); + MetaContact* mc = c->metaContact(); + if ( mc == ContactList::self()->myself() ) + continue; + mc->removeContact( c ); + c->deleteLater(); + if ( mc->contacts().count() == 0 ) //we can delete the metacontact + { + //get the first group and it's members + Group* group = mc->groups().first(); + QPtrList<MetaContact> groupMembers = group->members(); + ContactList::self()->removeMetaContact( mc ); + if ( groupMembers.count() == 1 && groupMembers.findRef( mc ) != -1 ) + ContactList::self()->removeGroup( group ); + } + } + // Clean up the account list d->accounts.remove( account ); @@ -319,11 +343,11 @@ { //kdDebug( 14010 ) << k_funcinfo << endl; d->accounts.sort(); - + for ( QPtrListIterator<Account> it( d->accounts ); it.current(); ++it ) { KConfigBase *config = it.current()->configGroup(); - + config->writeEntry( "Protocol", it.current()->protocol()->pluginId() ); config->writeEntry( "AccountId", it.current()->accountId() ); } @@ -386,7 +410,7 @@ kdDebug( 14010 ) << k_funcinfo << "Creating account for '" << accountId << "'" << endl; - + Account *account = 0L; account = registerAccount( protocol->createNewAccount( accountId ) ); if ( !account )
Great ! Thanks a lot :)