[Bug 60546] Custom project: Project/Project Options/Make Options/Environment Variables have no effect.
Amilcar do Carmo Lucas
amilcar at ida.ing.tu-bs.de
Tue Jul 1 10:43:05 UTC 2003
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=60546
amilcar at ida.ing.tu-bs.de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From amilcar at ida.ing.tu-bs.de 2003-07-01 10:41 -------
Subject: kdevelop/parts/customproject
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 at 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;
More information about the KDevelop-devel
mailing list