Fix bug #144947

Andreas Pakulat apaku at gmx.de
Thu May 3 22:04:21 UTC 2007


Hi,

the attached patch fixes Bug number 144947, a subtle bug in the new
custom makefile manager code I wrote for blacklisting files. The change
doesn't add directories in case a file with the same directory prefix is
already in the list of source files.

Andreas

-- 
You seek to shield those you love and you like the role of the provider.
-------------- next part --------------
Index: buildtools/custommakefiles/customprojectpart.cpp
===================================================================
--- buildtools/custommakefiles/customprojectpart.cpp	(Revision 660336)
+++ buildtools/custommakefiles/customprojectpart.cpp	(Arbeitskopie)
@@ -1607,6 +1607,24 @@ void CustomProjectPart::addNewFilesToPro
         m_recursive = false;
         QStringList blacklist = this->blacklist();
         QStringList excludelist = dlg->excludedPaths();
+        QStringList removeFromExcludes;
+        for( QStringList::const_iterator it = excludelist.begin(); it != excludelist.end(); ++it )
+        {
+            if( QFileInfo( projectDirectory()+"/"+*it ).isDir() )
+            {
+                for( QStringList::const_iterator it2 = m_sourceFiles.begin(); it2 != m_sourceFiles.end(); ++it2 )
+                {
+                    if( (*it2).find( *it ) != -1 )
+                    {
+                        removeFromExcludes << *it;
+                    }
+                }
+            }
+        }
+        for( QStringList::const_iterator it = removeFromExcludes.begin(); it != removeFromExcludes.end(); ++it )
+        {
+            excludelist.remove(*it);
+        }
         blacklist += excludelist;
         for( QStringList::const_iterator it = excludelist.begin(); it != excludelist.end(); ++it )
         {


More information about the KDevelop-devel mailing list