[Bug 69035] Run Options not honored

Amilcar do Carmo Lucas amilcar at ida.ing.tu-bs.de
Thu Jan 29 21:46:09 UTC 2004


------- 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=69035      
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  2004-01-29 21:45 -------
Subject: KDE_3_2_BRANCH: kdevelop/buildtools/custommakefiles

CVS commit by aclu: 

fix: Bug 69035: Run Options not honored (custommakefiles)

CCMAIL: 69035-done at bugs.kde.org


  M +19 -24    customprojectpart.cpp   1.68.2.1


--- kdevelop/buildtools/custommakefiles/customprojectpart.cpp  #1.68:1.68.2.1
@@ -592,23 +592,9 @@ void CustomProjectPart::slotExecute()
     }
 
-    QString directory;
-    QString program = project()->mainProgram();
-    int pos = program.findRev('/');
-    if (pos != -1) {
-        // Directory where the executable is
-        directory = program.left(pos+1);
-        // Executable name with a "./" prepended for execution with bash shells
-        program   = "./" + (project()->mainProgram()).mid(pos+1);
-    }
-
-    program += " " + DomUtil::readEntry(*projectDom(), "/kdevcustomproject/run/programargs");
-
     // Get the run 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/run/envvars", "envvar", "name", "value");
-
+    DomUtil::PairList envvars = runEnvironmentVars();
     QString environstr;
     DomUtil::PairList::ConstIterator it;
@@ -616,18 +602,27 @@ void CustomProjectPart::slotExecute()
         environstr += (*it).first;
         environstr += "=";
-/*
-#if (KDE_VERSION > 305)
-        environstr += KProcess::quote((*it).second);
-#else
-        environstr += KShellProcess::quote((*it).second);
-#endif
-*/
         environstr += EnvVarTools::quote((*it).second);
         environstr += " ";
     }
-    program.prepend(environstr);
+
+    if (mainProgram(true).isEmpty())
+    // Do not execute non executable targets
+        return;
+
+    QString program = environstr;
+    // Adds the ./ that is necessary to execute the program in bash shells
+    if (!mainProgram(true).startsWith("/"))
+        program += "./";
+    program += mainProgram(true);
+    program += " " + runArguments();
 
     bool inTerminal = DomUtil::readBoolEntry(*projectDom(), "/kdevcustomproject/run/terminal");
-    appFrontend()->startAppCommand(directory, program, inTerminal);
+
+    kdDebug(9025) << "runDirectory: <" << runDirectory() << ">" <<endl;
+    kdDebug(9025) << "environstr  : <" << environstr << ">" <<endl;
+    kdDebug(9025) << "mainProgram : <" << mainProgram(true) << ">" <<endl;
+    kdDebug(9025) << "runArguments: <" << runArguments() << ">" <<endl;
+
+    appFrontend()->startAppCommand(runDirectory(), program, inTerminal);
 }




More information about the KDevelop-devel mailing list