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

[tor-commits] [vidalia/master] Change QTime for QDateTime in StatusEventWidget/Item



commit 5e0de05b039b3e23b5287c92dd169c0784856ca6
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Wed Sep 7 12:21:41 2011 -0300

    Change QTime for QDateTime in StatusEventWidget/Item
---
 src/vidalia/log/StatusEventItem.cpp   |   12 ++++++------
 src/vidalia/log/StatusEventItem.h     |    6 +++---
 src/vidalia/log/StatusEventWidget.cpp |    4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/vidalia/log/StatusEventItem.cpp b/src/vidalia/log/StatusEventItem.cpp
index ef62360..a0ec2b2 100644
--- a/src/vidalia/log/StatusEventItem.cpp
+++ b/src/vidalia/log/StatusEventItem.cpp
@@ -15,7 +15,7 @@
 
 #include "StatusEventItem.h"
 
-#include <QTime>
+#include <QDateTime>
 #include <QPixmap>
 #include <QString>
 
@@ -25,15 +25,15 @@ StatusEventItem::StatusEventItem(QTreeWidget *parent)
 }
 
 void
-StatusEventItem::setTimestamp(const QTime &timestamp)
+StatusEventItem::setTimestamp(const QDateTime &timestamp)
 {
   setData(0, TimestampRole, timestamp);
 }
 
-QTime
+QDateTime
 StatusEventItem::timestamp() const
 {
-  return data(0, TimestampRole).toTime();
+  return data(0, TimestampRole).toDateTime();
 }
 
 void
@@ -101,8 +101,8 @@ StatusEventItem::toString() const
 bool
 StatusEventItem::operator<(const QTreeWidgetItem &other) const
 {
-  QTime a = data(0, TimestampRole).toTime();
-  QTime b = other.data(0, TimestampRole).toTime();
+  QDateTime a = data(0, TimestampRole).toDateTime();
+  QDateTime b = other.data(0, TimestampRole).toDateTime();
 
   return (a < b);
 }
diff --git a/src/vidalia/log/StatusEventItem.h b/src/vidalia/log/StatusEventItem.h
index 8e599a2..8aeb1cd 100644
--- a/src/vidalia/log/StatusEventItem.h
+++ b/src/vidalia/log/StatusEventItem.h
@@ -18,7 +18,7 @@
 
 #include <QTreeWidgetItem>
 
-class QTime;
+class QDateTime;
 class QPixmap;
 class QString;
 
@@ -44,12 +44,12 @@ public:
   /** Sets the <b>timestamp</b> at which this status event occurred.
    * \sa timestamp()
    */
-  void setTimestamp(const QTime &timestamp);
+  void setTimestamp(const QDateTime &timestamp);
 
   /** Returns the timestamp at which this status event occurred.
    * \sa setTimestamp()
    */
-  QTime timestamp() const;
+  QDateTime timestamp() const;
 
   /** Sets the icon to be drawn along with this status event to <b>pixmap</b>.
    * \sa icon()
diff --git a/src/vidalia/log/StatusEventWidget.cpp b/src/vidalia/log/StatusEventWidget.cpp
index 4bd11d0..c496aa1 100644
--- a/src/vidalia/log/StatusEventWidget.cpp
+++ b/src/vidalia/log/StatusEventWidget.cpp
@@ -186,7 +186,7 @@ StatusEventWidget::find(const QString &text, bool highlight)
       continue;
 
     if (item->title().contains(text, Qt::CaseInsensitive)
-          || item->description().contains(text, Qt::CaseInsensitive)) {
+        || item->description().contains(text, Qt::CaseInsensitive)) {
       items.append(item);
       if (highlight)
         item->setSelected(true);
@@ -217,7 +217,7 @@ StatusEventWidget::addNotification(const QPixmap &icon,
 
   // Create the new notification item
   StatusEventItem *item = new StatusEventItem(this);
-  item->setTimestamp(QTime::currentTime());
+  item->setTimestamp(QDateTime::currentDateTime());
   item->setIcon(icon);
   item->setTitle(title);
   item->setDescription(description);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits