From kmail-devel Tue Oct 31 20:26:09 2006 From: Christian Schaarschmidt Date: Tue, 31 Oct 2006 20:26:09 +0000 To: kmail-devel Subject: Re: Address completion (Re: Duplicates) Message-Id: <200610312126.10138.schaarsc () gmx ! de> X-MARC-Message: https://marc.info/?l=kmail-devel&m=116232640816480 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_hF7RFLevazWXPQT" --Boundary-00=_hF7RFLevazWXPQT Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Content-Disposition: inline On 2006-09-29 20:58:32 Carsten Pfeiffer wrote: > > > but then all the matches will be lower case as well ... > > > there must be an other way... > > > > Fix KCompletion.ignoreCase. :-) > KCompletion only performs the *matching* case insensitively, the matches > themselves are kept and returned in their original case. KCompletion::makeCompletion must use findAllCompletions in IgnorCase mode, otherwise IgnoreCase will not work for CompleteAuto. Patch is attached. To finish the "Address completion Patch" I have one wish for KLineEdit. I need a way to access menu items in "text completion" submenu to hide some of its entries. Either by adding a member function or, as demostrated in the patch, by using MenuID. PopupAuto will be disabled for addresseelineedit by my patch (if it gets ever commited :-) because popup items are in addr.fullEmail format and lookup is done on e.g. nickname. It does not make sense to autocomplete the nickname in this case. @Carsten: What is your opinion on this? Could you commit that change? or is it better to add a new method disableCompletionMenuItem(..)? in KDE4 will there be QAction or still menuItems? I have also attached a patch for kabc/scripts/addressee.src.cpp, it would be great if this could be commited as well. Regards Christian --Boundary-00=_hF7RFLevazWXPQT Content-Type: text/x-diff; charset="windows-1252"; name="addressee.src.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="addressee.src.diff" Index: kabc/scripts/addressee.src.cpp =================================================================== --- kabc/scripts/addressee.src.cpp (revision 599111) +++ kabc/scripts/addressee.src.cpp (working copy) @@ -182,8 +182,13 @@ --DEFINITIONS-- -void Addressee::setNameFromString( const QString &str ) +void Addressee::setNameFromString( const QString &s ) { + QString str = s; + //remove enclosing quotes from string + if ( str.length() > 1 && s[ 0 ] == '"' && s[ s.length() - 1 ] == '"' ) + str = s.mid( 1, s.length() - 2 ); + setFormattedName( str ); setName( str ); --Boundary-00=_hF7RFLevazWXPQT Content-Type: text/x-diff; charset="windows-1252"; name="kcompletion.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kcompletion.diff" Index: kdecore/kcompletion.cpp =================================================================== --- kdecore/kcompletion.cpp (revision 599111) +++ kdecore/kcompletion.cpp (working copy) @@ -219,7 +219,8 @@ QString completion; // in case-insensitive popup mode, we search all completions at once - if ( myCompletionMode == KGlobalSettings::CompletionPopup || + if ( myIgnoreCase || + myCompletionMode == KGlobalSettings::CompletionPopup || myCompletionMode == KGlobalSettings::CompletionPopupAuto ) { findAllCompletions( string, &d->matches, myHasMultipleMatches ); if ( !d->matches.isEmpty() ) --Boundary-00=_hF7RFLevazWXPQT Content-Type: text/x-diff; charset="windows-1252"; name="klineedit.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="klineedit.diff" Index: kdeui/klineedit.h =================================================================== --- kdeui/klineedit.h (revision 599111) +++ kdeui/klineedit.h (working copy) @@ -602,7 +602,7 @@ void slotRestoreSelectionColors(); void setTextWorkaround( const QString& text ); -private: +protected: // Constants that represent the ID's of the popup menu. enum MenuID @@ -616,6 +616,8 @@ PopupAutoCompletion }; +private: + /** * Initializes variables. Called from the constructors. */ --Boundary-00=_hF7RFLevazWXPQT Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail developers mailing list KMail-devel@kde.org https://mail.kde.org/mailman/listinfo/kmail-devel --Boundary-00=_hF7RFLevazWXPQT--