I continue my small bug fixing crusade in Kate =). I've noticed that in KDE4, the "Find in Files" kate plugin doesn't have directory completion anymore for the "Folder:" combo box.
In the code I see
cmbDir->completionObject()->setMode(KUrlCompletion::DirCompletion);. So in theory, it does have directory completion. I looked at the code in the Filesystem Browser to see how do they got it working, and it seems that they manually create the completionObject manually. I've done that, and it works. The attached patch is the result.
However I've found that KUrlCompletion doesn't work very well: sometimes it shows sometimes %2F at the end of the urls, and that sometimes, there are directories not shown in the url completion list. Any insight? =) Should I commit and backport this patch?
Index: plugins/findinfiles/kategrepdialog.cpp
===================================================================
--- plugins/findinfiles/kategrepdialog.cpp (revisión: 775296)
+++ plugins/findinfiles/kategrepdialog.cpp (copia de trabajo)
@@ -58,8 +58,10 @@
KComboBox* cmbUrl = cmbDir->comboBox();
cmbUrl->setDuplicatesEnabled(false);
cmbUrl->setEditable(true);
- cmbDir->completionObject()->setMode(KUrlCompletion::DirCompletion);
cmbDir->setMode( KFile::Directory | KFile::LocalOnly );
+ KUrlCompletion* cmpl = new KUrlCompletion(KUrlCompletion::DirCompletion);
+ cmbUrl->setCompletionObject( cmpl );
+ cmbUrl->setAutoDeleteCompletionObject( true );
cmbFiles->setInsertPolicy(QComboBox::NoInsert);
cmbFiles->setDuplicatesEnabled(false);