From 11e30e184b36d26bc0f55b942e8afc3b676b06e5 Mon Sep 17 00:00:00 2001 From: Bernhard Beschow Date: Sat, 5 Jun 2010 12:18:46 +0000 Subject: [PATCH] autocomplete directories svn path=/trunk/KDE/kdebase/apps/; revision=1134823 --- kfind/kftabdlg.cpp | 6 +++++- kfind/kftabdlg.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kfind/kftabdlg.cpp b/kfind/kftabdlg.cpp index 2a5362b71d..4422419747 100644 --- a/kfind/kftabdlg.cpp +++ b/kfind/kftabdlg.cpp @@ -32,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -75,8 +77,10 @@ KfindTabWidget::KfindTabWidget(QWidget *parent) namedL->setBuddy( nameBox ); namedL->setObjectName( "named" ); namedL->setToolTip( i18n("You can use wildcard matching and \";\" for separating multiple names") ); - dirBox = new KComboBox(pages[0]); + dirBox = new KUrlComboBox(KUrlComboBox::Directories, pages[0]); dirBox->setEditable( true ); + dirBox->setCompletionObject(new KUrlCompletion(KUrlCompletion::DirCompletion)); + dirBox->setAutoDeleteCompletionObject(true); dirBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); // allow smaller than widest entry QLabel * lookinL = new QLabel(i18n("Look &in:"), pages[0]); lookinL->setBuddy( dirBox ); diff --git a/kfind/kftabdlg.h b/kfind/kftabdlg.h index 15035ebdab..57c5b87147 100644 --- a/kfind/kftabdlg.h +++ b/kfind/kftabdlg.h @@ -25,6 +25,7 @@ #include #include +class KUrlComboBox; class QButtonGroup; class QPushButton; class QRadioButton; @@ -81,7 +82,7 @@ Q_SIGNALS: protected: public: KComboBox *nameBox; - KComboBox *dirBox; + KUrlComboBox *dirBox; // for first page QCheckBox *subdirsCb; QCheckBox *useLocateCb;