Various fixes by Klas Kalass <klas.kalass@gmx.de>

svn path=/trunk/kdebase/kfind/; revision=135684
This commit is contained in:
Waldo Bastian 2002-02-10 00:23:04 +00:00
parent e691d2eeb9
commit 1f4cb92690
4 changed files with 18 additions and 5 deletions

View file

@ -43,6 +43,7 @@ KfindDlg::KfindDlg(const KURL & url, QWidget *parent, const char *name)
// create tabwidget
tabWidget = new KfindTabWidget( frame, "dialog");
tabWidget->setURL( url );
// prepare window for find results
win = new KfindWindow(frame,"window");

View file

@ -257,6 +257,8 @@ void KfindTabWidget::setURL( const KURL & url )
conf->setGroup("History");
m_url = url;
QStringList sl = conf->readListEntry("Directories", ',');
dirBox->clear(); // make sure there is no old Stuff in there
if(!sl.isEmpty()) {
dirBox->insertStringList(sl);
// If the _searchPath already exists in the list we do not

View file

@ -67,8 +67,17 @@ void KQuery::slotListEntries( KIO::Job *, const KIO::UDSEntryList & list)
if ( file->name() == "." || file->name() == ".." )
continue;
if ( !m_regexp.isEmpty() &&
m_regexp.search( file->url().fileName( true ) ) == -1 )
QRegExp *filename_match;
bool matched=false;
for ( filename_match = m_regexps.first(); !matched && filename_match; filename_match = m_regexps.next() )
{
matched |= filename_match->isEmpty() ||
(filename_match->exactMatch( file->url().fileName( true ) ) );
}
if (!matched)
continue;
// make sure the files are in the correct range
@ -204,7 +213,8 @@ void KQuery::setTimeRange(time_t from, time_t to)
void KQuery::setRegExp(const QString &regexp, bool caseSensitive)
{
QStringList strList=QStringList::split( QString(" "), regexp, false);
QRegExp sep(";");
QStringList strList=QStringList::split( sep, regexp, false);
m_regexps.clear();
for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it )
m_regexps.append(new QRegExp((*it),caseSensitive,true));

View file

@ -48,13 +48,13 @@ class KQuery : public QObject
KURL m_url;
time_t m_timeFrom;
time_t m_timeTo;
QRegExp m_regexp;
QRegExp m_regexp;// regexp for file content
bool m_recursive;
QString m_mimetype;
QString m_context;
bool m_casesensitive;
bool m_regexpForContent;
QPtrList<QRegExp> m_regexps;
QPtrList<QRegExp> m_regexps;// regexps for file name
KIO::ListJob *job;
};