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

[vidalia-svn] r3394: Add a method to UpdateProcess to set a socks port and pass i (vidalia/branches/auto-updates/src/vidalia)



Author: edmanm
Date: 2008-12-13 02:45:00 -0500 (Sat, 13 Dec 2008)
New Revision: 3394

Modified:
   vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp
   vidalia/branches/auto-updates/src/vidalia/updateprocess.h
Log:
Add a method to UpdateProcess to set a socks port and pass it to thandy
on the command line if one is set.


Modified: vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp
===================================================================
--- vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp	2008-12-13 07:44:06 UTC (rev 3393)
+++ vidalia/branches/auto-updates/src/vidalia/updateprocess.cpp	2008-12-13 07:45:00 UTC (rev 3394)
@@ -22,6 +22,8 @@
   : QProcess(parent)
 {
   _currentCommand = NoCommand;
+  _socksPort = 0;
+
   connect(this, SIGNAL(readyReadStandardError()),
           this, SLOT(readStandardError()));
   connect(this, SIGNAL(readyReadStandardOutput()),
@@ -39,8 +41,12 @@
 
   args << "update"  << "--controller-log-format"
        << "--repo=" + updateRepositoryDir()
-       << "--debug" << bundleInfoToString(bi);
+       << "--debug";
+  if (_socksPort)
+    args << "--socks-port=" + QString::number(_socksPort);
 
+  args << bundleInfoToString(bi);
+
   vNotice("updater: launching auto-update executable: %1 %2")
                                            .arg(updateExecutable())
                                            .arg(args.join(" "));
@@ -56,8 +62,12 @@
 
   args << "update" << "--controller-log-format"
        << "--repo=" + updateRepositoryDir()
-       << "--install" << bundleInfoToString(bi);
+       << "--install";
+  if (_socksPort)
+    args << "--socks-port=" + QString::number(_socksPort);
 
+  args << bundleInfoToString(bi);
+
   vNotice("updater: launching auto-update executable: %1 %2")
                                            .arg(updateExecutable())
                                            .arg(args.join(" "));
@@ -66,6 +76,12 @@
   start(updateExecutable(), args);
 }
 
+void
+UpdateProcess::setSocksPort(quint16 port)
+{
+  _socksPort = port;
+}
+
 bool
 UpdateProcess::isRunning() const
 {

Modified: vidalia/branches/auto-updates/src/vidalia/updateprocess.h
===================================================================
--- vidalia/branches/auto-updates/src/vidalia/updateprocess.h	2008-12-13 07:44:06 UTC (rev 3393)
+++ vidalia/branches/auto-updates/src/vidalia/updateprocess.h	2008-12-13 07:45:00 UTC (rev 3394)
@@ -47,6 +47,11 @@
    */
   bool isRunning() const;
 
+  /** Sets the port to use as a SOCKS proxy to <b>port</b>. If <b>port</b> is
+   * set to 0, then no SOCKS proxy will be used when checking for updates.
+   */
+  void setSocksPort(quint16 port);
+
   /** Return the time at which we should next check for available updates,
    * given the last we checked was at <b>lastCheckedAt</b>.
    */
@@ -156,6 +161,9 @@
 
   /** List of packages that have available updates. */
   PackageList _packageList;
+
+  /** Currently configured SOCKS port. */
+  quint16 _socksPort;
 };
 
 #endif