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

[vidalia-svn] r2208: Steven's patch reminded me of a couple tweaks I should make (in trunk: . src/torcontrol)



Author: edmanm
Date: 2007-12-09 14:51:13 -0500 (Sun, 09 Dec 2007)
New Revision: 2208

Modified:
   trunk/
   trunk/src/torcontrol/torprocess.cpp
   trunk/src/torcontrol/torprocess.h
Log:
 r2282@lysithea:  edmanm | 2007-12-09 14:49:45 -0500
 Steven's patch reminded me of a couple tweaks I should make to TorProcess.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /local/vidalia/trunk [r2282] on 0108964c-5b0b-4c9e-969f-e2288315d100

Modified: trunk/src/torcontrol/torprocess.cpp
===================================================================
--- trunk/src/torcontrol/torprocess.cpp	2007-12-09 19:51:06 UTC (rev 2207)
+++ trunk/src/torcontrol/torprocess.cpp	2007-12-09 19:51:13 UTC (rev 2208)
@@ -50,7 +50,7 @@
 
 /** Formats the Tor process arguments for logging. */
 QString
-TorProcess::formatArguments(const QStringList args)
+TorProcess::formatArguments(const QStringList &args)
 {
   QStringList out;
   foreach (QString arg, args) {
@@ -64,12 +64,13 @@
  * signal started() will be emitted. If Tor fails to start,
  * startFailed(errmsg) will be emitted, with an appropriate error message. */
 void
-TorProcess::start(QString app, QStringList args) 
+TorProcess::start(const QString &app, const QStringList &args) 
 {
+  QString exe = app;
 #if defined(Q_OS_WIN32)
   /* If we're on Windows, QProcess::start requires that paths with spaces are
    * quoted before being passed to it. */
-  app = "\"" + app + "\"";
+  exe = "\"" + exe + "\"";
 #endif
   
   /* Attempt to start Tor with the given command-line arguments */
@@ -87,7 +88,7 @@
   setEnvironment(env);
 
 //  vNotice("Starting Tor using '%1 %2'").arg(app).arg(formatArguments(args));
-  QProcess::start(app, args, QIODevice::ReadOnly | QIODevice::Text);
+  QProcess::start(exe, args, QIODevice::ReadOnly | QIODevice::Text);
 }
 
 /** Stops the Tor process */

Modified: trunk/src/torcontrol/torprocess.h
===================================================================
--- trunk/src/torcontrol/torprocess.h	2007-12-09 19:51:06 UTC (rev 2207)
+++ trunk/src/torcontrol/torprocess.h	2007-12-09 19:51:13 UTC (rev 2208)
@@ -40,7 +40,7 @@
   TorProcess(QObject *parent = 0);
 
   /** Start the Tor process */
-  void start(QString app, QStringList args);
+  void start(const QString &app, const QStringList &args);
   /** Stop the Tor process */
   bool stop(QString *errmsg = 0);
 
@@ -54,10 +54,10 @@
 
 signals:
   /** Emitted when Tor prints a log message to the console */
-  void log(QString severity, QString message);
+  void log(const QString &severity, const QString &message);
   /** Emitted when Tor fails to start, perhaps because the path to Tor was
    * bogus. */
-  void startFailed(QString errorMessage);
+  void startFailed(const QString &errorMessage);
   
 private slots:
   /** Called when there is data to be read from stdout */
@@ -67,7 +67,7 @@
 
 private:
   /** Formats the Tor process arguments for logging. */
-  QString formatArguments(const QStringList args);
+  QString formatArguments(const QStringList &args);
 };
 
 #endif