branches/kdevelop/3.4/buildtools/qmake

Andreas Pakulat apaku at gmx.de
Fri Nov 3 20:54:19 UTC 2006


SVN commit 601609 by apaku:

Improve Variable handling in included project file
This also changes the way .pri files are handled, we now don't take over the variable values from the "parent" project/scope, so .pri now behave the same as .pro.

QMake users please test this, if it breaks anything that worked until now report it on kdevelop-devel or IRC. However I hope to fix the problems with .pri files with this, especially when .pri files are used by different .pro files in the same project...

CCMAIL: kdevelop-devel at kdevelop.org


 M  +7 -3      qmakescopeitem.cpp  
 M  +7 -5      scope.cpp  


--- branches/kdevelop/3.4/buildtools/qmake/qmakescopeitem.cpp #601608:601609
@@ -686,24 +686,28 @@
 
 void QMakeScopeItem::removeValue( const QString& var, const QString& value )
 {
-    while( scope->variableValues( var ).contains( value ) )
+    if( scope->scopeType() != Scope::IncludeScope && scope->variableValues( var ).contains( value ) )
     {
         if( scope->variableValuesForOp( var, "+=" ).contains(value) )
             scope->removeFromPlusOp( var, QStringList( value ) );
         else
             scope->addToMinusOp( var, QStringList( value ) );
+    }else if( scope->scopeType() == Scope::IncludeScope )
+    {
+        scope->addToMinusOp( var, QStringList( value ) );
     }
 }
 
 void QMakeScopeItem::addValue( const QString& var, const QString& value )
 {
-    while( !scope->variableValues( var ).contains( value ) )
+    if( scope->scopeType() != Scope::IncludeScope && !scope->variableValues( var ).contains( value ) )
     {
         if( scope->variableValuesForOp( var, "-=" ).contains(value) )
             scope->removeFromMinusOp( var, QStringList( value ) );
         else
             scope->addToPlusOp( var, QStringList( value ) );
-    }
+    }else if( scope->scopeType() == Scope::IncludeScope )
+        scope->addToPlusOp( var, QStringList( value ) );
 }
 
 void QMakeScopeItem::updateValues( const QString& var, const QStringList& values )
--- branches/kdevelop/3.4/buildtools/qmake/scope.cpp #601608:601609
@@ -317,10 +317,10 @@
     {
         result = m_parent->calcValuesFromStatements( variable, result , this->m_root );
     }
-    else if ( scopeType() == IncludeScope )
-    {
-        result = m_parent->calcValuesFromStatements( variable, result , this->m_incast );
-    }
+//     else if ( scopeType() == IncludeScope )
+//     {
+//         result = m_parent->calcValuesFromStatements( variable, result , this->m_incast );
+//     }
 
     QValueList<QMake::AST*>::const_iterator it;
     for ( it = m_root->m_children.begin(); it != m_root->m_children.end(); ++it )
@@ -1155,8 +1155,10 @@
     if( !m_root || ( m_root->isProject() && !m_incast ) )
         return 0;
 
-    if( variableValuesForOp( "SUBDIRS", "+=").contains( dir ) )
+    if( scopeType() != Scope::IncludeScope && variableValuesForOp( "SUBDIRS", "+=").contains( dir ) )
         removeFromPlusOp( "SUBDIRS", dir );
+    else if( scopeType() != Scope::IncludeScope )
+        removeFromPlusOp( "SUBDIRS", dir );
 
     QDir curdir( projectDir() );
 




More information about the KDevelop-devel mailing list