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

List:       kde-commits
Subject:    kdevelop/parts/autoproject
From:       Roberto Raggi <raggi () cli ! di ! unipi ! it>
Date:       2003-03-11 23:53:39
[Download RAW message or body]

CVS commit by raggi: 

added all existings headers to the current project


  M +22 -14    autosubprojectview.cpp   1.2


--- kdevelop/parts/autoproject/autosubprojectview.cpp  #1.1:1.2
@@ -289,16 +289,24 @@ void AutoSubprojectView::parsePrimary( S
 
                         QString sources = item->variables[ canonname + "_SOURCES" ];
-                        QStringList l2 = QStringList::split( QRegExp( "[ \t\n]" ), sources );
-                        QStringList::Iterator it2;
-                        for ( it2 = l2.begin(); it2 != l2.end(); ++it2 )
-                        {
-                                FileItem *fitem = m_widget->createFileItem( *it2 );
-                                titem->sources.append( fitem );
-                                if ( !m_widget->kdeMode() || !( *it2 ).endsWith( ".cpp" ) )
-                                        continue;
-                                QString header = ( *it2 ).left( ( *it2 ).length() - 4 ) + ".h";
-                                if ( sources.contains( header ) )
-                                        continue;
-                                fitem = m_widget->createFileItem( header );
+                        QStringList sourceList = QStringList::split( QRegExp( "[ \t\n]" ), sources );
+                        
+                        // TODO: only if in a c++ project
+                        kdDebug(9020) << "-------------> path = " << (item->path) << endl;
+                        QDir dir( item->path );
+                        sourceList += dir.entryList( "*.h;*.H;*.hh;*.hxx;*.hpp;*.tcc", QDir::Files );
+                        
+                        QMap<QString, bool> dict;
+                        QStringList::Iterator it = sourceList.begin();
+                        while( it != sourceList.end() ){
+                            kdDebug(9020) << "------------> include " << (*it) << endl;
+                            dict.insert( *it, true );
+                            ++it;
+                        }
+                        
+                        QMap<QString, bool>::Iterator dictIt = dict.begin();
+                        while( dictIt != dict.end() ){
+                                FileItem *fitem = m_widget->createFileItem( dictIt.key() );
+                                ++dictIt;
+                                
                                 titem->sources.append( fitem );
                         }


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

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