[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/kio/kio
From: David Faure <faure () kde ! org>
Date: 2005-04-25 16:21:21
Message-ID: 20050425162121.74171488 () office ! kde ! org
[Download RAW message or body]
CVS commit by faure:
Make code simpler (it's strictly equivalent, just easier to read)
Add comment
M +5 -6 kdirlister.cpp 1.198
--- kdelibs/kio/kio/kdirlister.cpp #1.197:1.198
@@ -2197,12 +2197,8 @@ void KDirLister::handleError( KIO::Job *
void KDirLister::addNewItem( const KFileItem *item )
{
- bool isNameFilterMatch = (d->dirOnlyMode && !item->isDir()) || !matchesFilter( \
item );
-
- if ( isNameFilterMatch )
+ if ( ( d->dirOnlyMode && !item->isDir() ) || !matchesFilter( item ) )
return; // No reason to continue... bailing out here prevents a mimetype scan.
- bool isMimeFilterMatch = !matchesMimeFilter( item );
-
- if ( !isNameFilterMatch && !isMimeFilterMatch )
+ if ( matchesMimeFilter( item ) )
{
if ( !d->lstNewItems )
@@ -2223,4 +2219,7 @@ void KDirLister::addNewItems( const KFil
{
// TODO: make this faster - test if we have a filter at all first
+ // DF: was this profiled? The matchesFoo() functions should be fast, w/o \
filters... + // Of course if there is no filter and we can do a range-insertion \
instead of a loop, that might be good. + // But that's for Qt4, not possible with \
QPtrList. for ( KFileItemListIterator kit( items ); kit.current(); ++kit )
addNewItem( *kit );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic