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

List:       kde-core-devel
Subject:    Re: Completion (Was: Key management)
From:       Dawit Alemayehu <adawit () earthlink ! net>
Date:       1999-11-27 18:00:17
[Download RAW message or body]

On Sat, 27 Nov 1999, Carsten Pfeiffer wrote:
> On Fri, Nov 26, 1999 at 05:25:29PM -0500, Dawit Alemayehu wrote:
> 
> Hi,
>  
> > > Yes. You can call QComboBox::setAutoCompletion( bool ) for editable
> > > boxes and whenever you type something that matches an item in the
> > > combobox, it is auto-completed. So it would be easy to make a KComboBox
> > > using KCompletion and caring about auto/manual completion issues.
> > 
> > Right. I will do this. I will default to QComboBox's auto-completion if user
> > wants auto-completion and emit a completion signal for a manual-completion. 
> > The two types of completions would be mutually exclusive.
> 
> I'm not sure if it suffices to use QComboBox's auto-completion, e.g. in
> kfile, you have some recently selected files in the box, but the
> auto-completion also completes all files in the current directory (so
> KCompletion has to be used as well).

Hmmm... how will this work ?  In kfile's case for example, are you first
attempting a match with the list of previouly selected and if not found
attempt a match with files in the current directory ?  If so, what happens
for cases where there is not current directory etc ...

> Can you provide a mechanism to use either QComboBox's auto-completion or
> one with KCompletion? Or even both?
> Something like
> 
> KComboBox::setAutoCompletion( CompletionMode, CompletionScope );
> enum CompletionMode { None, Manual, Auto };
> enum CompletionScope { ComboEntries, ExtraEntries, All };

I do not think there is any need to do this.  I will simply connect to
KCompletion for both types of completions.  If people want to use QComboBox's
autocompletion feature then they should use QComboBox.

> And IMHO, KComboBox (and KLineEdit) should create and manage the
> KCompletion-object themself and provide an accessor 
> KCompletion * KComboBox::completion()

I have been thinking about this.  But I think I will have to add both an
accessor and mutator methods in KComboBox and KLineEdit :

KCompletion* completionObject()
void setCompletionObject ( KCompletion* completion )

This way people can connect thier own customized KCompletion class if
they need to.  However, by default I will make them create and manage
a KCompletion object.  Can you make sure that the slots in KCompletion are
virtual.  I thought I saved a copy header file from your original post, but I
did not :(  

If you have the chance, can you send me (personal mail) copy of KCompletion
class in a compressed format ?  I have already completed KLineEdit and am
starting on KComboBox, but I need KCompletion to test this last change.

Regards,
Dawit A.

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

Configure | About | News | Add a list | Sponsored by KoreLogic