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

[vidalia-svn] r1290: Trim newlines off log event messages in the LogEvent constru (in trunk/src: control gui/log)



Author: edmanm
Date: 2006-10-04 23:14:07 -0400 (Wed, 04 Oct 2006)
New Revision: 1290

Modified:
   trunk/src/control/logevent.cpp
   trunk/src/control/torevents.cpp
   trunk/src/gui/log/logtreeitem.cpp
Log:
Trim newlines off log event messages in the LogEvent constructor, instead of
the class that parses and dispatches events from the control socket, since
we also read log messages from stdout before the control socket is connected.
This fixes the problem we have with Qt 4.1.4, where message log rows are
ridiculously tall.


Modified: trunk/src/control/logevent.cpp
===================================================================
--- trunk/src/control/logevent.cpp	2006-10-05 01:25:23 UTC (rev 1289)
+++ trunk/src/control/logevent.cpp	2006-10-05 03:14:07 UTC (rev 1290)
@@ -34,7 +34,7 @@
 : QEvent((QEvent::Type)CustomEventType::LogEvent)
 {
   _severity = severity;
-  _message  = message;
+  _message  = message.trimmed();
 }
 
 /** Converts a string description of a severity to its enum value */

Modified: trunk/src/control/torevents.cpp
===================================================================
--- trunk/src/control/torevents.cpp	2006-10-05 01:25:23 UTC (rev 1289)
+++ trunk/src/control/torevents.cpp	2006-10-05 03:14:07 UTC (rev 1290)
@@ -277,8 +277,7 @@
   QString logLine = (line.getData().size() > 0 ? line.getData().join("\n") :
                                                  msg.mid(i+1));
 
-  /* Post the event to each of the interested targets */
-  dispatch(toTorEvent(severity), new LogEvent(severity, logLine.trimmed()));
+  dispatch(toTorEvent(severity), new LogEvent(severity, logLine));
 }
 
 /** Handle an OR Connection Status event. The syntax is:

Modified: trunk/src/gui/log/logtreeitem.cpp
===================================================================
--- trunk/src/gui/log/logtreeitem.cpp	2006-10-05 01:25:23 UTC (rev 1289)
+++ trunk/src/gui/log/logtreeitem.cpp	2006-10-05 03:14:07 UTC (rev 1290)
@@ -59,14 +59,6 @@
   setSeverity(type);
   /* Set the item's message text. */
   setMessage(message);
-
-#if QT_VERSION > 0x040100
-  /* Qt versions newer than 4.1.0 have a quirk in that they make the message
-   * log rows appear very tall. So, make them just a hair taller than the font
-   * height. */
-  int rowHeight = font(COL_MESG).pointSize()+VERTICAL_PADDING;
-  setSizeHint(COL_TIME, QSize(sizeHint(COL_TIME).width(), rowHeight));
-#endif
 }
 
 /** Returns a printable string representing the fields of this item. */