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

[vidalia-svn] r3192: Just read and log whatever the updater process dumps to its (vidalia/trunk/src/vidalia)



Author: edmanm
Date: 2008-09-30 20:33:40 -0400 (Tue, 30 Sep 2008)
New Revision: 3192

Modified:
   vidalia/trunk/src/vidalia/gliderprocess.cpp
   vidalia/trunk/src/vidalia/gliderprocess.h
Log:
Just read and log whatever the updater process dumps to its stdout and stderr
for now, until we know what format to expect the output to be in. Then we can
add the bits to parse and act on the output.


Modified: vidalia/trunk/src/vidalia/gliderprocess.cpp
===================================================================
--- vidalia/trunk/src/vidalia/gliderprocess.cpp	2008-09-30 23:26:14 UTC (rev 3191)
+++ vidalia/trunk/src/vidalia/gliderprocess.cpp	2008-10-01 00:33:40 UTC (rev 3192)
@@ -8,12 +8,18 @@
 **  terms described in the LICENSE file.
 */
 
+#include <QtDebug>
+
 #include "gliderprocess.h"
 
 
 GliderProcess::GliderProcess(QObject *parent)
   : QProcess(parent)
 {  
+  connect(this, SIGNAL(readyReadStandardError()),
+          this, SLOT(readStandardError()));
+  connect(this, SIGNAL(readyReadStandardOutput()),
+          this, SLOT(readStandardOutput()));
 }
 
 void
@@ -23,6 +29,30 @@
   start(gliderExecutable, args);
 }
 
+void
+GliderProcess::readStandardError()
+{
+  QString line;
+
+  setReadChannel(QProcess::StandardError);
+  while (canReadLine()) {
+    line = readLine();
+    qDebug() << QString("updater (stderr): %1").arg(line);
+  }  
+}
+
+void
+GliderProcess::readStandardOutput()
+{
+  QString line;
+
+  setReadChannel(QProcess::StandardOutput);
+  while (canReadLine()) {
+    line = readLine();
+    qDebug() << QString("updater (stdout): %1").arg(line);
+  }
+}
+
 int
 GliderProcess::checkForUpdatesInterval()
 {

Modified: vidalia/trunk/src/vidalia/gliderprocess.h
===================================================================
--- vidalia/trunk/src/vidalia/gliderprocess.h	2008-09-30 23:26:14 UTC (rev 3191)
+++ vidalia/trunk/src/vidalia/gliderprocess.h	2008-10-01 00:33:40 UTC (rev 3192)
@@ -46,6 +46,17 @@
   /** Returns the preferred interval (in seconds) between executions of the
    * Glider process to check for available software updates. */
   static int checkForUpdatesInterval();
+
+protected slots:
+  /** Called when there is data to be read from the update process's stdout.
+   * Reads and parses all available data.
+   */
+  void readStandardOutput();
+
+  /** Called when there is data to be read from the update process's stderr.
+   * Reads and parses all available data.
+   */
+  void readStandardError();
 };
 
 #endif