Making path completion case insensitive
Diaa Sami
diaasami at gmail.com
Sat Jan 17 23:31:31 GMT 2009
Thanks for the pointer David.
I've got one more patch for KFM.
This patch does two things, it enables case-insensitivity for the the path combobox(at the top of the file dialog) and it moves the code that enables case-insensitivity for the location edit(near the bottom) bottom to kdelibs/kfile/kfilewidget.cpp, the last change was made for consistency(and it should make all components using kfilewidget case-insensitive).
The changes had to be moved to kdelibs/kfile/kfilewidget.cpp because pathCombo wasn't accessible in kfiledialog.
You can find the patch below:
Index: kdelibs/kfile/kfilewidget.cpp
===================================================================
--- kdelibs/kfile/kfilewidget.cpp (revision 911086)
+++ kdelibs/kfile/kfilewidget.cpp (working copy)
@@ -497,6 +497,7 @@
d->toolbar->setMovable(false);
KUrlCompletion *pathCompletionObj = new KUrlCompletion( KUrlCompletion::DirCompletion );
+ pathCompletionObj->setIgnoreCase(true);
pathCombo->setCompletionObject( pathCompletionObj );
pathCombo->setAutoDeleteCompletionObject( true );
@@ -522,6 +523,7 @@
d->locationLabel->setBuddy(d->locationEdit);
KUrlCompletion *fileCompletionObj = new KUrlCompletion( KUrlCompletion::FileCompletion );
+ fileCompletionObj->setIgnoreCase(true);
d->locationEdit->setCompletionObject( fileCompletionObj );
d->locationEdit->setAutoDeleteCompletionObject( true );
connect( fileCompletionObj, SIGNAL( match( const QString& ) ),
Index: kdelibs/kio/kfile/kfiledialog.cpp
===================================================================
--- kdelibs/kio/kfile/kfiledialog.cpp (revision 911086)
+++ kdelibs/kio/kfile/kfiledialog.cpp (working copy)
@@ -282,11 +282,6 @@
if (customWidget)
d->w->setCustomWidget(QString(), customWidget);
-
- if (!d->native) {
- KCompletion* comp = d->w->locationEdit()->completionObject();
- comp->setIgnoreCase(true);
- }
}
More information about the kfm-devel
mailing list