[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kdevelop/3.4/buildtools/custommakefiles
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2007-03-11 21:01:52
Message-ID: 1173646912.960034.30027.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 641572 by apaku:

Let QDir do the pattern matching, this is much faster than kdevelop iterating


 M  +24 -10    customprojectpart.cpp  


--- branches/kdevelop/3.4/buildtools/custommakefiles/customprojectpart.cpp \
#641571:641572 @@ -478,7 +478,9 @@
 {
     if( dir.isEmpty() )
         return;
-    QStringList entries = QDir(dir).entryList();
+    QStringList fileentries = QDir(dir).entryList( filetypes().join(";") );
+    QStringList dirs = QDir(dir).entryList(QDir::Dirs);
+    QStringList entries = fileentries+dirs;
     QString relpath = relativeToProject( dir );
     if( !relpath.isEmpty() )
         relpath += "/";
@@ -681,7 +683,9 @@
         if ( QFileInfo( projectDirectory() + "/" + relpath ).isDir() && ( \
m_recursive || m_first_recursive ) )  {
             m_first_recursive = false;
-            QStringList subentries = QDir( projectDirectory() + "/" + relpath \
).entryList(); +            QStringList fileentries = QDir( projectDirectory() + "/" \
+ relpath ).entryList( filetypes().join(";") ); +            QStringList dirs = QDir( \
projectDirectory() + "/" + relpath ).entryList(QDir::Dirs); +            QStringList \
                subentries = fileentries+dirs;
             for ( QStringList::iterator subit = subentries.begin(); subit != \
subentries.end(); ++subit )  if ( *subit != "." && *subit != ".." )
                     *subit = relpath + "/" + ( *subit );
@@ -748,7 +752,9 @@
         if ( QFileInfo( projectDirectory() + "/" + relpath ).isDir() && ( \
m_recursive || m_first_recursive ) )  {
             m_first_recursive = false;
-            QStringList subentries = QDir( projectDirectory() + "/" + relpath \
).entryList(); +            QStringList fileentries = QDir( projectDirectory() + "/" \
+ relpath ).entryList( filetypes().join(";") ); +            QStringList dirs = QDir( \
projectDirectory() + "/" + relpath ).entryList(QDir::Dirs); +            QStringList \
                subentries = fileentries+dirs;
             for ( QStringList::iterator subit = subentries.begin(); subit != \
subentries.end(); ++subit )  if ( *subit != "." && *subit != ".." )
                     *subit = relpath + "/" + ( *subit );
@@ -1343,7 +1349,9 @@
 {
     if( isInBlacklist( dir ) )
         return false;
-    QStringList subentries = QDir( dir ).entryList();
+    QStringList fileentries = QDir( dir ).entryList( filetypes().join(";") );
+    QStringList dirs = QDir( dir ).entryList(QDir::Dirs);
+    QStringList subentries = fileentries+dirs;
     subentries.remove(".");
     subentries.remove("..");
     for ( QStringList::const_iterator it = subentries.begin(); it != \
subentries.end(); ++it ) @@ -1357,8 +1365,7 @@
                 return true;
             }
         }
-        else if ( isProjectFileType( *it )
-                && !project()->isProjectFile( URLUtil::canonicalPath( dir + "/" + \
*it ) ) +        else if ( !project()->isProjectFile( URLUtil::canonicalPath( dir + \
"/" + *it ) )  && !isInBlacklist( *it ) )
         {
             return true;
@@ -1371,7 +1378,10 @@
 {
     if( isInBlacklist( dir ) )
         return false;
-    QStringList subentries = QDir( dir ).entryList();
+
+    QStringList fileentries = QDir( dir ).entryList( filetypes().join(";") );
+    QStringList dirs = QDir( dir ).entryList(QDir::Dirs);
+    QStringList subentries = fileentries+dirs;
     subentries.remove(".");
     subentries.remove("..");
     for ( QStringList::const_iterator it = subentries.begin(); it != \
subentries.end(); ++it ) @@ -1386,7 +1396,7 @@
                 return true;
             }
         }
-        else if ( isProjectFileType( *it ) && project()->isProjectFile( \
URLUtil::canonicalPath( dir + "/" + *it ) ) && !isInBlacklist( *it ) ) +        else \
if ( project()->isProjectFile( URLUtil::canonicalPath( dir + "/" + *it ) ) && \
!isInBlacklist( *it ) )  {
             return true;
         }
@@ -1397,7 +1407,9 @@
 QStringList CustomProjectPart::projectFilesInDir( const QString& dir )
 {
     QStringList result;
-    QStringList subentries = QDir( projectDirectory()+"/"+dir ).entryList();
+    QStringList fileentries = QDir( projectDirectory() + "/" + dir ).entryList( \
filetypes().join(";") ); +    QStringList dirs = QDir( projectDirectory() + "/" + dir \
).entryList(QDir::Dirs); +    QStringList subentries = fileentries+dirs;
     subentries.remove(".");
     subentries.remove("..");
     for ( QStringList::const_iterator it = subentries.begin(); it != \
subentries.end(); ++it ) @@ -1462,7 +1474,9 @@
     updateBlacklist( blacklist );
     removeFiles(remove);
 
-    QStringList files = QDir(dir).entryList();
+    QStringList fileentries = QDir( dir ).entryList( filetypes().join(";") );
+    QStringList dirs = QDir( dir ).entryList(QDir::Dirs);
+    QStringList files = fileentries+dirs;
     files.remove(".");
     files.remove("..");
     for( QStringList::const_iterator it = files.begin(); it != files.end(); ++it )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic