[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r3383: Let the auto-updater's QProcess inherit the system environme (vidalia/branches/auto-updates/src/vidalia)



Author: edmanm
Date: 2008-12-12 16:19:52 -0500 (Fri, 12 Dec 2008)
New Revision: 3383

Modified:
   vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp
Log:
Let the auto-updater's QProcess inherit the system environment variables, and
switch to launching a thandy.exe that lives in the user's PATH rather than
playing the python game ourselves.


Modified: vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp
===================================================================
--- vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp	2008-12-11 04:58:55 UTC (rev 3382)
+++ vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp	2008-12-12 21:19:52 UTC (rev 3383)
@@ -28,6 +28,8 @@
           this, SLOT(readStandardOutput()));
   connect(this, SIGNAL(finished(int, QProcess::ExitStatus)),
           this, SLOT(onFinished(int, QProcess::ExitStatus)));
+
+  setEnvironment(systemEnvironment());
 }
 
 void
@@ -35,8 +37,7 @@
 {
   QStringList args;
 
-  args << "E:\\thandy\\lib\\thandy\\ClientCLI.py"
-       << "update"  << "--controller-log-format" 
+  args << "update"  << "--controller-log-format"
        << "--repo=" + updateRepositoryDir()
        << "--debug" << bundleInfoToString(bi);
 
@@ -53,11 +54,10 @@
 {
   QStringList args;
 
-  args << "E:\\thandy\\lib\\thandy\\ClientCLI.py"
-       << "update" << "--controller-log-format"
+  args << "update" << "--controller-log-format"
        << "--repo=" + updateRepositoryDir()
        << "--install" << bundleInfoToString(bi);
-  
+
   vNotice("updater: launching auto-update executable: %1 %2")
                                            .arg(updateExecutable())
                                            .arg(args.join(" "));
@@ -164,8 +164,7 @@
 QString
 UpdateProcess::updateExecutable()
 {
-  /* XXX: Super lame. Just use python to run thandy for now. */
-  return "python.exe";
+  return "thandy.exe";
 }
 
 QString
@@ -191,13 +190,14 @@
   QProcess proc;
   QStringList args;
 
-  args << "E:\\thandy\\lib\\thandy\\ClientCLI.py"
-       << "json2xml" 
+  args << "json2xml"
        << QDir::convertSeparators(updateRepositoryDir() + "/" + package);
-  
+
   vNotice("updater: launching auto-update executable: %1 %2")
                                            .arg(updateExecutable())
                                            .arg(args.join(" "));
+
+  proc.setEnvironment(proc.systemEnvironment());
   proc.start(updateExecutable(), args);
   if (! proc.waitForStarted())
     return PackageInfo();
@@ -218,7 +218,7 @@
 
   if (! doc.setContent(xml, false, &errmsg, 0, 0))
     goto err;
-  
+
   /* XXX: Qt 4.4 introduced XPath support, which would make the following
    * parsing much easier. Whenever we drop support for Qt < 4.4, this should
    * be updated.