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

List:       kde-commits
Subject:    kdevelop/parts/customproject
From:       Amilcar do Carmo Lucas <amilcar () ida ! ing ! tu-bs ! de>
Date:       2003-07-01 8:41:49
[Download RAW message or body]

CVS commit by aclu: 

Fix Project/Project Options/Make Options/Environment Variables have no effect
Patch by: John W Eckhart < jeckhart in us.ibm.com > Thanks for the patch!!!

CCMAIL: 60546-done@bugs.kde.org


  M +26 -0     customprojectpart.cpp   1.52
  M +1 -0      customprojectpart.h   1.14


--- kdevelop/parts/customproject/customprojectpart.cpp  #1.51:1.52
@@ -332,4 +332,29 @@ QString CustomProjectPart::buildDirector
 
 
+QString CustomProjectPart::makeEnvironment()
+{
+    // Get the make environment variables pairs into the environstr string
+    // in the form of: "ENV_VARIABLE=ENV_VALUE"
+    // Note that we quote the variable value due to the possibility of
+    // embedded spaces
+    DomUtil::PairList envvars =
+        DomUtil::readPairListEntry(*projectDom(), "/kdevcustomproject/make/envvars", \
"envvar", "name", "value"); +
+    QString environstr;
+    DomUtil::PairList::ConstIterator it;
+    for (it = envvars.begin(); it != envvars.end(); ++it) {
+        environstr += (*it).first;
+        environstr += "=";
+#if (KDE_VERSION > 305)
+        environstr += KProcess::quote((*it).second);
+#else
+        environstr += KShellProcess::quote((*it).second);
+#endif
+        environstr += " ";
+    }
+    return environstr;
+}
+
+
 void CustomProjectPart::startMakeCommand(const QString &dir, const QString &target)
 {
@@ -374,4 +399,5 @@ void CustomProjectPart::startMakeCommand
     dircmd += " && ";
 
+    cmdline.prepend(makeEnvironment());
     makeFrontend()->queueCommand(dir, dircmd + cmdline);
 }

--- kdevelop/parts/customproject/customprojectpart.h  #1.13:1.14
@@ -70,4 +70,5 @@ private:
     void populateProject();
     void startMakeCommand(const QString &dir, const QString &target);
+    QString makeEnvironment();
 
     QString m_projectDirectory;


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

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