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

[vidalia-svn] r4132: Stop trying to enforce proper quoting and escaping of argume (in vidalia/trunk: . src/vidalia src/vidalia/config)



Author: edmanm
Date: 2009-09-23 22:28:18 -0400 (Wed, 23 Sep 2009)
New Revision: 4132

Modified:
   vidalia/trunk/CHANGELOG
   vidalia/trunk/src/vidalia/HelperProcess.cpp
   vidalia/trunk/src/vidalia/HelperProcess.h
   vidalia/trunk/src/vidalia/config/GeneralPage.cpp
   vidalia/trunk/src/vidalia/config/VidaliaSettings.cpp
   vidalia/trunk/src/vidalia/config/VidaliaSettings.h
Log:

Stop trying to enforce proper quoting and escaping of arguments to be
given to the proxy executable (e.g., Polipo). Now the user is on their
own for properly formatting the command line used to start the proxy
executable. (Ticket #523)


Modified: vidalia/trunk/CHANGELOG
===================================================================
--- vidalia/trunk/CHANGELOG	2009-09-23 21:35:19 UTC (rev 4131)
+++ vidalia/trunk/CHANGELOG	2009-09-24 02:28:18 UTC (rev 4132)
@@ -4,6 +4,10 @@
   o Add a context menu for highlighted event items in the "Basic" message
     log view that allows the user to copy the selected item text to the
     clipboard.
+  o Stop trying to enforce proper quoting and escaping of arguments to be
+    given to the proxy executable (e.g., Polipo). Now the user is on their
+    own for properly formatting the command line used to start the proxy
+    executable. (Ticket #523)
 
 
 0.2.4   07-Sep-2009

Modified: vidalia/trunk/src/vidalia/HelperProcess.cpp
===================================================================
--- vidalia/trunk/src/vidalia/HelperProcess.cpp	2009-09-23 21:35:19 UTC (rev 4131)
+++ vidalia/trunk/src/vidalia/HelperProcess.cpp	2009-09-24 02:28:18 UTC (rev 4132)
@@ -82,6 +82,21 @@
   }
 }
 
+void
+HelperProcess::start(const QString &app, const QString &args)
+{
+  QFileInfo fi(app);
+  _processName = fi.fileName();
+
+  QString commandLine = QString("\"%1\" %2").arg(app).arg(args);
+
+   // Log the process name and arguments
+  vNotice("Launching helper process with command line '%1'")
+                                           .arg(commandLine);
+
+  QProcess::start(commandLine, QIODevice::ReadOnly | QIODevice::Text);
+}
+
 /** Start the specified application. */
 void
 HelperProcess::start(const QString &app, const QStringList &args) 

Modified: vidalia/trunk/src/vidalia/HelperProcess.h
===================================================================
--- vidalia/trunk/src/vidalia/HelperProcess.h	2009-09-23 21:35:19 UTC (rev 4131)
+++ vidalia/trunk/src/vidalia/HelperProcess.h	2009-09-24 02:28:18 UTC (rev 4132)
@@ -51,6 +51,10 @@
 public:
   /** Default constructor */
   HelperProcess(QObject *parent = 0);
+  /** Start <b>app</b> with <b>args</b> appended to the end of the command
+   * line. <b>app</b> will be quoted, so an executable name with spaces is
+   * acceptable. */
+  void start(const QString &app, const QString &args);
   /** Start the specified application. */
   void start(const QString &app, const QStringList &args);
   /** Returns true iff process is not running. */

Modified: vidalia/trunk/src/vidalia/config/GeneralPage.cpp
===================================================================
--- vidalia/trunk/src/vidalia/config/GeneralPage.cpp	2009-09-23 21:35:19 UTC (rev 4131)
+++ vidalia/trunk/src/vidalia/config/GeneralPage.cpp	2009-09-24 02:28:18 UTC (rev 4132)
@@ -112,15 +112,9 @@
     return false;
   }
   if (ui.chkRunProxyAtTorStartup->isChecked()) {
-    bool ok;
-    QStringList proxyArgs = string_parse_arguments(
-                              ui.lineProxyExecutableArguments->text(), &ok);
-    if (! ok) {
-      errmsg = tr("The proxy arguments specified are not properly formatted.");
-      return false;
-    }
     _vidaliaSettings->setProxyExecutable(ui.lineProxyExecutable->text());
-    _vidaliaSettings->setProxyExecutableArguments(proxyArgs);
+    _vidaliaSettings->setProxyExecutableArguments(
+      ui.lineProxyExecutableArguments->text());
   }
   
   _torSettings->setExecutable(torExecutable);
@@ -144,7 +138,7 @@
 
   ui.lineProxyExecutable->setText(_vidaliaSettings->getProxyExecutable());
   ui.lineProxyExecutableArguments->setText(
-    string_format_arguments(_vidaliaSettings->getProxyExecutableArguments()));
+    _vidaliaSettings->getProxyExecutableArguments());
   ui.chkRunProxyAtTorStartup->setChecked(_vidaliaSettings->runProxyAtStart());
 }
 

Modified: vidalia/trunk/src/vidalia/config/VidaliaSettings.cpp
===================================================================
--- vidalia/trunk/src/vidalia/config/VidaliaSettings.cpp	2009-09-23 21:35:19 UTC (rev 4131)
+++ vidalia/trunk/src/vidalia/config/VidaliaSettings.cpp	2009-09-24 02:28:18 UTC (rev 4132)
@@ -72,7 +72,7 @@
   setDefault(SETTING_IM_EXECUTABLE, "");
   setDefault(SETTING_RUN_PROXY_AT_START, false);
   setDefault(SETTING_PROXY_EXECUTABLE, "");
-  setDefault(SETTING_PROXY_EXECUTABLE_ARGUMENTS, QStringList());
+  setDefault(SETTING_PROXY_EXECUTABLE_ARGUMENTS, QString());
 #if defined(Q_WS_WIN)
   setDefault(SETTING_CHECK_FOR_UPDATES, true);
 #else
@@ -254,17 +254,17 @@
   setValue(SETTING_PROXY_EXECUTABLE, proxyExecutable);
 }
 
-/** Returns a list containing additional command line arguments to be passed
+/** Returns a string containing additional command line arguments to be passed
  * to ProxyExecutable */
-QStringList
+QString
 VidaliaSettings::getProxyExecutableArguments() const
 {
-  return value(SETTING_PROXY_EXECUTABLE_ARGUMENTS).toStringList();
+  return value(SETTING_PROXY_EXECUTABLE_ARGUMENTS).toString();
 }
 
 /** Sets the additional arguments to be passed to Proxy Executable */
 void
-VidaliaSettings::setProxyExecutableArguments(const QStringList
+VidaliaSettings::setProxyExecutableArguments(const QString
                                              &proxyExecutableArguments)
 {
   setValue(SETTING_PROXY_EXECUTABLE_ARGUMENTS, proxyExecutableArguments);

Modified: vidalia/trunk/src/vidalia/config/VidaliaSettings.h
===================================================================
--- vidalia/trunk/src/vidalia/config/VidaliaSettings.h	2009-09-23 21:35:19 UTC (rev 4131)
+++ vidalia/trunk/src/vidalia/config/VidaliaSettings.h	2009-09-24 02:28:18 UTC (rev 4132)
@@ -99,9 +99,9 @@
 
   /** Returns a list containing additional command line arguments to be
    * passed to ProxyExecutable */
-  QStringList getProxyExecutableArguments() const;
+  QString getProxyExecutableArguments() const;
   /** Sets the additional arguments to be passed to Proxy Executable */
-  void setProxyExecutableArguments(const QStringList &proxyExecutableArguments);
+  void setProxyExecutableArguments(const QString &proxyExecutableArguments);
   
   /** Returns true if Vidalia should automatically check for software updates.
    */