diff --git a/ChangeLog b/ChangeLog index 05ba00e71..9af6dcb42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-05 Tobias Doerffel + + * include/file_browser.h: + * src/gui/file_browser.cpp: + do not examine directories for being empty when adding them - speeds + up LMMS-startup a lot! + 2008-04-04 Paul Giblock * include/knob.h: diff --git a/include/file_browser.h b/include/file_browser.h index d2a6479c8..2eee2a747 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -53,9 +53,6 @@ public: QWidget * _parent ); virtual ~fileBrowser(); - static bool isDirWithContent( const QString & _path, - const QString & _filter ); - public slots: void reloadTree( void ); diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index ba0b93afa..a9bc9d70c 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -100,9 +100,7 @@ void fileBrowser::addItems( const QString & _path ) it != files.constEnd(); ++it ) { QString cur_file = *it; - if( cur_file[0] != '.' && - isDirWithContent( _path + QDir::separator() + cur_file, - m_filter ) ) + if( cur_file[0] != '.' ) { bool orphan = TRUE; for( int i = 0; i < m_l->topLevelItemCount(); ++i ) @@ -137,14 +135,7 @@ void fileBrowser::addItems( const QString & _path ) it != files.constEnd(); ++it ) { QString cur_file = *it; - if( cur_file[0] != '.' -#warning TODO: add match here -#ifdef QT4 -// TBD -#else -// && QDir::match( m_filter, cur_file.lower() ) -#endif - ) + if( cur_file[0] != '.' ) { // TODO: don't insert instead of removing, order changed // remove existing file-items @@ -162,41 +153,6 @@ void fileBrowser::addItems( const QString & _path ) -bool fileBrowser::isDirWithContent( const QString & _path, - const QString & _filter ) -{ - QDir cdir( _path ); - QStringList files = cdir.entryList( QDir::Files, QDir::Unsorted ); - for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) - { - QString cur_file = *it; - if( cur_file[0] != '.' -#warning TODO: add match here - && QDir::match( _filter, cur_file.toLower() ) - ) - { - return( TRUE ); - } - } - - files = cdir.entryList( QDir::Dirs, QDir::Unsorted ); - for( QStringList::iterator it = files.begin(); it != files.end(); ++it ) - { - QString cur_file = *it; - if( cur_file[0] != '.' && - isDirWithContent( _path + QDir::separator() + cur_file, - _filter ) ) - { - return( TRUE ); - } - } - - return( FALSE ); -} - - - - void fileBrowser::keyPressEvent( QKeyEvent * _ke ) { if( _ke->key() == Qt::Key_F5 ) @@ -708,9 +664,7 @@ bool directory::addItems( const QString & _path ) it != files.constEnd(); ++it ) { QString cur_file = *it; - if( cur_file[0] != '.' && fileBrowser::isDirWithContent( - thisDir.absolutePath() + QDir::separator() + - cur_file, m_filter ) ) + if( cur_file[0] != '.' ) { bool orphan = TRUE; for( int i = 0; i < childCount(); ++i )