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

[vidalia-svn] r2581: And some const touch-ups. (in vidalia: . trunk/src/torcontrol)



Author: edmanm
Date: 2008-05-19 18:46:16 -0400 (Mon, 19 May 2008)
New Revision: 2581

Modified:
   vidalia/
   vidalia/trunk/src/torcontrol/controlconnection.cpp
   vidalia/trunk/src/torcontrol/controlconnection.h
Log:
 r320@thebe:  edmanm | 2008-05-19 18:46:54 -0400
 And some const touch-ups.



Property changes on: vidalia
___________________________________________________________________
 svk:merge ticket from /local/vidalia [r320] on 45a62a8a-8088-484c-baad-c7b3e776dd32

Modified: vidalia/trunk/src/torcontrol/controlconnection.cpp
===================================================================
--- vidalia/trunk/src/torcontrol/controlconnection.cpp	2008-05-19 22:46:14 UTC (rev 2580)
+++ vidalia/trunk/src/torcontrol/controlconnection.cpp	2008-05-19 22:46:16 UTC (rev 2581)
@@ -46,7 +46,7 @@
 
 /** Connect to the specified Tor control interface. */
 void
-ControlConnection::connect(QHostAddress addr, quint16 port)
+ControlConnection::connect(const QHostAddress &addr, quint16 port)
 {
   if (isRunning()) {
     tc::error("Bug: Tried to call ControlConnection::connect() when the "
@@ -196,7 +196,8 @@
 
 /** Sends a control command to Tor and waits for the reply. */
 bool
-ControlConnection::send(ControlCommand cmd, ControlReply &reply, QString *errmsg)
+ControlConnection::send(const ControlCommand &cmd,
+                        ControlReply &reply, QString *errmsg)
 {
   ReceiveWaiter w;
   bool result = false;
@@ -227,7 +228,7 @@
 /** Sends a control command to Tor and returns without waiting for the
  * response. */
 bool
-ControlConnection::send(ControlCommand cmd, QString *errmsg)
+ControlConnection::send(const ControlCommand &cmd, QString *errmsg)
 {
   QMutexLocker locker(&_connMutex);
   return _sock->sendCommand(cmd, errmsg);
@@ -342,8 +343,8 @@
 /** Sets the result and reply from a control command. */
 void 
 ControlConnection::ReceiveWaiter::setResult(bool success, 
-                                            ControlReply reply, 
-                                            QString errmsg)
+                                            const ControlReply &reply, 
+                                            const QString &errmsg)
 {
   _mutex.lock();
   _status = (success ? Success : Failed);

Modified: vidalia/trunk/src/torcontrol/controlconnection.h
===================================================================
--- vidalia/trunk/src/torcontrol/controlconnection.h	2008-05-19 22:46:14 UTC (rev 2580)
+++ vidalia/trunk/src/torcontrol/controlconnection.h	2008-05-19 22:46:16 UTC (rev 2581)
@@ -50,7 +50,7 @@
   ~ControlConnection();
 
   /** Connect to the specified Tor control interface. */
-  void connect(QHostAddress addr, quint16 port);
+  void connect(const QHostAddress &addr, quint16 port);
   /** Cancels a pending control connection to Tor. */
   void cancelConnect();
   /** Disconnect from Tor's control interface. */
@@ -60,9 +60,9 @@
   /** Returns the status of the control connection. */
   Status status();
   /** Sends a control command to Tor and waits for the reply. */
-  bool send(ControlCommand cmd, ControlReply &reply, QString *errmsg = 0);
+  bool send(const ControlCommand &cmd, ControlReply &reply, QString *errmsg = 0);
   /** Sends a control command to Tor and does not wait for a reply. */
-  bool send(ControlCommand cmd, QString *errmsg = 0);
+  bool send(const ControlCommand &cmd, QString *errmsg = 0);
 
 signals:
   /** Emitted when a control connection has been established. */
@@ -111,8 +111,8 @@
       /** Waits for and gets the reply from a control command. */
       bool getResult(ControlReply *reply, QString *errmsg = 0);
       /** Sets the result and reply from a control command. */
-      void setResult(bool success, ControlReply reply, 
-                     QString errmsg = QString());
+      void setResult(bool success, const ControlReply &reply, 
+                     const QString &errmsg = QString());
     private:
       /** Status of the receive waiter. */
       enum ReceiveStatus { Waiting, Failed, Success } _status;