Version: 1.6.82 (using KDE 3.2.3, compiled sources) Compiler: gcc version 3.2.2 OS: Linux (i686) release 2.4.19-64GB-SMP Hi! I frequently encounter the situation, that an address, which has been available a few days before, isn't available for autocompletion any more. As it is a very frequently used address, it shouldn't drop out of the list in any case. BTW I recompile kmail CVS_HEAD every night. cu ferdinand
This looks like a normal bug not a wishlist item.
This bug still exists in KMail 1.7.2. If the address isn't in the addres book or on an ldap server or something like that, after a few days the address is no longer available for autocompletion.
> This bug still exists in KMail 1.7.2. If the address isn't in the addres book or on an ldap server or something like that, after a few days the address is no longer available for autocompletion. The "recent addresses" list stores 40 addresses by default, you can find them in ~/.kde/share/config/kmailrc, under [General], as "Recent Addresses=..." Can you check that there are 40 more recent addresses there, which would explain why the address you're expecting was pushed out? Seems it's the last address from the list that gets removed when adding a 41st address. New addresses are added in front of the list, so that part looks fine. This number is configurable: you can add in that group a line saying Maximum Recent Addresses=300 while kmail is *not* running. I'm not saying there's no bug, merely providing hints on how to track it down, if there's one.
So what you are saying is that a frequently used address can move to the end of the list if 40 other adresses are used. IMHO a better solution would be to remove every address of an email from the list and add it immediately to the beginning of the list again. this way frequently used addresses will never move to the end and eventually be eliminated.
Hmm! May be someone could take care of that? it's sort of a thing nobody will understand why it happens.
I think that should be introduced proper address history management. I mean options like "number of addresses to remember", or "autocompletion: sort alphabetically, by usage frequency", plus population history from folder, etc etc etc.
A short term solution would be just to increase the default number of recent addresses. 40 is really low, something like 300 or 500 sounds better. Thomas
is this a dup of Bug 47333 ?
NO to http://bugs.kde.org/show_bug.cgi?id=85539#c8 http://bugs.kde.org/show_bug.cgi?id=47333 is a valid feature request, this one is a bug, because it does not keep frequently used addresses but in contrary "looses" them instead of not used ones.
Created attachment 20530 [details] move recent address to begin there is another bug, this method is not working for multiple addresses. I'll commit to kdepim+ once I have fixed that too
SVN commit 663553 by schaarsc: - place latest address at beginning of recent address list - handle multiple addresses properly CCBUG: 85539 M +24 -14 recentaddresses.cpp --- branches/work/kdepim-3.5.5+/libkdepim/recentaddresses.cpp #663552:663553 @@ -28,6 +28,7 @@ * your version. */ #include "recentaddresses.h" +#include "libemailfunctions/email.h" #include <kstaticdeleter.h> #include <kconfig.h> @@ -98,24 +99,33 @@ void RecentAddresses::add( const QString& entry ) { - if ( !entry.isEmpty() && m_maxCount > 0 ) { - QString email; - QString fullName; - KABC::Addressee addr; + if ( !entry.isEmpty() && m_maxCount > 0 ) { + QStringList list = KPIM::splitEmailAddrList( entry ); + for( QStringList::const_iterator e_it = list.begin(); e_it != list.end(); ++e_it ) { + KPIM::EmailParseResult errorCode = KPIM::isValidEmailAddress( *e_it ); + if ( errorCode != KPIM::AddressOk ) + continue; + QString email; + QString fullName; + KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( entry, fullName, email ); + KABC::Addressee::parseEmailAddress( *e_it, fullName, email ); - for ( KABC::Addressee::List::Iterator it = m_addresseeList.begin(); - it != m_addresseeList.end(); ++it ) - { - if ( email == (*it).preferredEmail() ) - return;//already inside + for ( KABC::Addressee::List::Iterator it = m_addresseeList.begin(); + it != m_addresseeList.end(); ++it ) + { + if ( email == (*it).preferredEmail() ) { + //already inside, remove it here and add it later at pos==1 + m_addresseeList.remove( it ); + break; } - addr.setNameFromString( fullName ); - addr.insertEmail( email, true ); - m_addresseeList.prepend( addr ); - adjustSize(); + } + addr.setNameFromString( fullName ); + addr.insertEmail( email, true ); + m_addresseeList.prepend( addr ); + adjustSize(); } + } } void RecentAddresses::setMaxCount( int count )
SVN commit 671909 by schaarsc: port r663553 - place latest address at beginning of recent address list - handle multiple addresses properly BUG: 85539 M +24 -14 recentaddresses.cpp --- branches/KDE/3.5/kdepim/libkdepim/recentaddresses.cpp #671908:671909 @@ -28,6 +28,7 @@ * your version. */ #include "recentaddresses.h" +#include "libemailfunctions/email.h" #include <kstaticdeleter.h> #include <kconfig.h> @@ -98,24 +99,33 @@ void RecentAddresses::add( const QString& entry ) { - if ( !entry.isEmpty() && m_maxCount > 0 ) { - QString email; - QString fullName; - KABC::Addressee addr; + if ( !entry.isEmpty() && m_maxCount > 0 ) { + QStringList list = KPIM::splitEmailAddrList( entry ); + for( QStringList::const_iterator e_it = list.begin(); e_it != list.end(); ++e_it ) { + KPIM::EmailParseResult errorCode = KPIM::isValidEmailAddress( *e_it ); + if ( errorCode != KPIM::AddressOk ) + continue; + QString email; + QString fullName; + KABC::Addressee addr; - KABC::Addressee::parseEmailAddress( entry, fullName, email ); + KABC::Addressee::parseEmailAddress( *e_it, fullName, email ); - for ( KABC::Addressee::List::Iterator it = m_addresseeList.begin(); - it != m_addresseeList.end(); ++it ) - { - if ( email == (*it).preferredEmail() ) - return;//already inside + for ( KABC::Addressee::List::Iterator it = m_addresseeList.begin(); + it != m_addresseeList.end(); ++it ) + { + if ( email == (*it).preferredEmail() ) { + //already inside, remove it here and add it later at pos==1 + m_addresseeList.remove( it ); + break; } - addr.setNameFromString( fullName ); - addr.insertEmail( email, true ); - m_addresseeList.prepend( addr ); - adjustSize(); + } + addr.setNameFromString( fullName ); + addr.insertEmail( email, true ); + m_addresseeList.prepend( addr ); + adjustSize(); } + } } void RecentAddresses::setMaxCount( int count )
just want to make sure that this fix does not break the meanwhile alphabetically sorted list. one thing is the storage of the latest addresses, other thing is to display them alphabetically