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

List:       kde-commits
Subject:    branches/KDE/3.5/kdevelop/buildtools/qmake
From:       Andreas Pakulat <apaku () gmx ! de>
Date:       2007-04-11 16:25:39
Message-ID: 1176308739.302398.30549.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 652641 by apaku:

Substitute shell variables with real values. Note: The shell variables need to be set \
when starting KDevelop Also fix a small bug along the way wrt. opening include( \
foobar.pri ). BUG:144063


 M  +18 -1     scope.cpp  


--- branches/KDE/3.5/kdevelop/buildtools/qmake/scope.cpp #652640:652641
@@ -883,7 +883,7 @@
         {
             QMake::IncludeAST * i = static_cast<QMake::IncludeAST*>( *it );
             QString filename = i->projectName;
-            if( i->projectName.startsWith("$") )
+            if( i->projectName.stripWhiteSpace().startsWith("$") )
             {
                 filename = resolveVariables(i->projectName, *it);
             }
@@ -1250,6 +1250,23 @@
                 pos += re.matchedLength();
             }
         }
+        re = QRegExp("\\$\\$\\(([^\\)\\}]*)\\)");
+        pos = 0;
+        QMap<QString, QString> envvars;
+        while( pos >= 0 )
+        {
+            pos = re.search( (*it), pos );
+            if( pos > -1 )
+            {
+                if( !envvars.contains( re.cap(1) ) && ::getenv( \
re.cap(1).local8Bit() ) != 0 ) +                    envvars[re.cap(1)] = \
QString::fromLocal8Bit(::getenv( re.cap(1).local8Bit() ) ); +                pos += \
re.matchedLength(); +            }
+        }
+        for( QMap<QString, QString>::const_iterator it2 = envvars.begin(); it2 != \
envvars.end(); ++it2 ) +        {
+            (*it).replace("$$("+it2.key()+")", it2.data() );
+        }
         for( QMap<QString, QStringList>::const_iterator it2 = variables.begin(); it2 \
!= variables.end(); ++it2 )  {
             for( QStringList::const_iterator it3 = it2.data().begin(); it3 != \
it2.data().end(); ++it3 )


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

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