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

[vidalia-svn] r2207: Lightly tweak sjmurdoch's patch: Clean up a couple unused va (in trunk: . src/vidalia)



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

Modified:
   trunk/
   trunk/src/vidalia/browserprocess.cpp
   trunk/src/vidalia/browserprocess.h
   trunk/src/vidalia/mainwindow.cpp
   trunk/src/vidalia/mainwindow.h
Log:
 r2281@lysithea:  edmanm | 2007-12-09 14:48:54 -0500
 Lightly tweak sjmurdoch's patch: Clean up a couple unused variables, replace
 some tabs with spaces, Doxygenate the BrowserProcess class, and indulge my
 recent const-correctness fetish.



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

Modified: trunk/src/vidalia/browserprocess.cpp
===================================================================
--- trunk/src/vidalia/browserprocess.cpp	2007-12-09 19:50:55 UTC (rev 2206)
+++ trunk/src/vidalia/browserprocess.cpp	2007-12-09 19:51:06 UTC (rev 2207)
@@ -1,6 +1,9 @@
 /****************************************************************
- *  This file is distributed under the following license:
+ *  This file was originally written by Steven J. Murdoch, and 
+ *  modified by Matt Edman. It is distributed under the following
+ *  license:
  *
+ *  Copyright (C) 2007, Matt Edman
  *  Copyright (C) 2007, Steven J. Murdoch 
  *                      <http://www.cl.cam.ac.uk/users/sjm217/>
  *
@@ -21,29 +24,34 @@
  ****************************************************************/
 
 /**
- ** Test invoking Firefox from Qt
- ** Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/>
- ** $Id$
- **/
+ * \file browserprocess.cpp
+ * \version $Id: $
+ * \brief Invokes a web browser process (originally by Steven. J. Murdoch)
+ */
 
 #include <QString>
   
 #include "browserprocess.h"
 
+
+/** Default constructor */
 BrowserProcess::BrowserProcess(QObject *parent)
 : QProcess(parent)
 {
   // Call error handling routine on errors
-  QObject::connect(this, SIGNAL(error(QProcess::ProcessError)), this, SLOT(onError(QProcess::ProcessError)));
+  QObject::connect(this, SIGNAL(error(QProcess::ProcessError)),
+                   this, SLOT(onError(QProcess::ProcessError)));
 }
 
+/** Start the specified application. */
 void
-BrowserProcess::start(QString app, QStringList args) 
+BrowserProcess::start(const QString &app, const QStringList &args) 
 {
   // Start the specified application
   QProcess::start(app, args, QIODevice::ReadOnly | QIODevice::Text);
 }
 
+/** Invoked when underlying QProcess fails. */
 void
 BrowserProcess::onError(QProcess::ProcessError error)
 {
@@ -52,3 +60,4 @@
     emit startFailed(errorString());
   }
 }
+

Modified: trunk/src/vidalia/browserprocess.h
===================================================================
--- trunk/src/vidalia/browserprocess.h	2007-12-09 19:50:55 UTC (rev 2206)
+++ trunk/src/vidalia/browserprocess.h	2007-12-09 19:51:06 UTC (rev 2207)
@@ -1,6 +1,9 @@
 /****************************************************************
- *  This file is distributed under the following license:
- *
+ *  This file was originally written by Steven J. Murdoch, and 
+ *  modified by Matt Edman. It is distributed under the following
+ *  license:
+ * 
+ *  Copyright (C) 2007, Matt Edman
  *  Copyright (C) 2007, Steven J. Murdoch 
  *                      <http://www.cl.cam.ac.uk/users/sjm217/>
  *
@@ -21,33 +24,34 @@
  ****************************************************************/
 
 /**
- ** Test invoking Firefox from Qt
- ** Steven J. Murdoch <http://www.cl.cam.ac.uk/users/sjm217/>
- ** $Id$
- **/
+ * \file browserprocess.cpp
+ * \version $Id: $ 
+ * \brief Invokes a web browser process (originally by Steven. J. Murdoch)
+ */
 
 #ifndef _BROWSERPROCESS_H
 #define _BROWSERPROCESS_H
 
 #include <QProcess>
 
+
 class BrowserProcess : public QProcess
 {
   Q_OBJECT
 
 public:
-  // Default constructor
+  /** Default constructor */
   BrowserProcess(QObject *parent = 0);
-  // Start the specified application
-  void start(QString app, QStringList args);
+  /** Start the specified application. */
+  void start(const QString &app, const QStringList &args);
 
 private slots:
-  // Invoked when underlying QProcess fails
+  /** Invoked when underlying QProcess fails. */
   void onError(QProcess::ProcessError error);
 
 signals:
-  // Invoked when start() fails
-  void startFailed(QString errorMessage);
+  /** Invoked when start() fails. */
+  void startFailed(const QString &errorMessage);
 };
 
 #endif

Modified: trunk/src/vidalia/mainwindow.cpp
===================================================================
--- trunk/src/vidalia/mainwindow.cpp	2007-12-09 19:50:55 UTC (rev 2206)
+++ trunk/src/vidalia/mainwindow.cpp	2007-12-09 19:51:06 UTC (rev 2207)
@@ -155,9 +155,9 @@
   /* Create a new BrowserProcess object, used to start the web browser */
   _browserProcess = new BrowserProcess(this);
   connect(_browserProcess, SIGNAL(finished(int, QProcess::ExitStatus)),
-	         this, SLOT(onBrowserFinished(int, QProcess::ExitStatus)));
+           this, SLOT(onBrowserFinished(int, QProcess::ExitStatus)));
   connect(_browserProcess, SIGNAL(startFailed(QString)),
-	         this, SLOT(onBrowserFailed(QString)));
+           this, SLOT(onBrowserFailed(QString)));
 
   /* Catch signals when the application is running or shutting down */
   connect(vApp, SIGNAL(running()), this, SLOT(running()));
@@ -435,7 +435,7 @@
 }
 
 /** Starts the web browser, if appropriately configured */
-void MainWindow::startBrowser(TorStatus status)
+void MainWindow::startBrowser()
 {
   VidaliaSettings settings;
   QString executable = settings.getBrowserExecutable();
@@ -447,6 +447,9 @@
 /** Called when browser has exited */
 void MainWindow::onBrowserFinished(int exitCode, QProcess::ExitStatus exitStatus)
 {
+  Q_UNUSED(exitCode)
+  Q_UNUSED(exitStatus)
+
   shutdown();
 }
 
@@ -458,9 +461,9 @@
   Q_UNUSED(errmsg);
  
   /* Display an error message and see if the user wants some help */
-  int response = VMessageBox::warning(this, tr("Error starting web browser"),
-				      tr("Vidalia was unable to start the configured web browser"),
-				      VMessageBox::Ok|VMessageBox::Default|VMessageBox::Escape);
+  VMessageBox::warning(this, tr("Error starting web browser"),
+              tr("Vidalia was unable to start the configured web browser"),
+              VMessageBox::Ok|VMessageBox::Default|VMessageBox::Escape);
 }
 
 /** Updates the UI to reflect Tor's current <b>status</b>. Returns the
@@ -1042,7 +1045,7 @@
 MainWindow::circuitEstablished()
 {
   updateTorStatus(CircuitEstablished);
-  startBrowser(CircuitEstablished);
+  startBrowser();
 }
 
 /** Checks the status of the current version of Tor to see if it's old,

Modified: trunk/src/vidalia/mainwindow.h
===================================================================
--- trunk/src/vidalia/mainwindow.h	2007-12-09 19:50:55 UTC (rev 2206)
+++ trunk/src/vidalia/mainwindow.h	2007-12-09 19:51:06 UTC (rev 2207)
@@ -153,7 +153,7 @@
    * previously set TorStatus value. */
   TorStatus updateTorStatus(TorStatus status);
   /** Starts the web browser, if appropriately configured */
-  void startBrowser(TorStatus status);
+  void startBrowser();
   /** Converts a TorStatus enum value to a string for debug logging purposes. */
   QString toString(TorStatus status);
   /** Authenticates Vidalia to Tor's control port. */