LogTreeItem Class Reference

#include <LogTreeItem.h>

List of all members.

Public Member Functions

 LogTreeItem (tc::Severity type, const QString &message, const QDateTime &timestamp=QDateTime::currentDateTime())
void setTimestamp (const QDateTime &timestamp)
void setSeverity (tc::Severity type)
void setMessage (const QString &message)
quint32 id () const
QDateTime timestamp () const
tc::Severity severity () const
QString message () const
QString toString () const
virtual bool operator< (const QTreeWidgetItem &other) const

Static Public Member Functions

static QString severityToString (tc::Severity severity)

Private Attributes

quint32 _seqnum

Detailed Description

Definition at line 27 of file LogTreeItem.h.


Constructor & Destructor Documentation

LogTreeItem::LogTreeItem ( tc::Severity  type,
const QString &  message,
const QDateTime &  timestamp = QDateTime::currentDateTime() 
)

Default constructor.

Definition at line 33 of file LogTreeItem.cpp.

References _seqnum, setMessage(), setSeverity(), and setTimestamp().


Member Function Documentation

quint32 LogTreeItem::id (  )  const [inline]

Returns this message's sequence number.

Definition at line 44 of file LogTreeItem.h.

References _seqnum.

Referenced by LogTreeWidget::qlist_sort().

QString LogTreeItem::message (  )  const

Returns the message associated with this log item.

Returns the message for this log item.

Definition at line 114 of file LogTreeItem.cpp.

References COL_MESG.

Referenced by operator<().

bool LogTreeItem::operator< ( const QTreeWidgetItem &  other  )  const [virtual]

Compares other to this log message item based on the current sort column and order.

Compares other to this log message item based on the current sort column.

Definition at line 138 of file LogTreeItem.cpp.

References _seqnum, COL_TIME, COL_TYPE, message(), and severity().

void LogTreeItem::setMessage ( const QString &  message  ) 

Sets the item's message text.

Definition at line 92 of file LogTreeItem.cpp.

References COL_MESG, and string_wrap().

Referenced by LogTreeItem().

void LogTreeItem::setSeverity ( tc::Severity  type  ) 

Sets the item's severity and appropriate background color.

Sets the item's severity and the appropriate background color.

Definition at line 69 of file LogTreeItem.cpp.

References COL_TYPE, tc::ErrorSeverity, i(), ROLE_TYPE, severityToString(), and tc::WarnSeverity.

Referenced by LogTreeItem().

void LogTreeItem::setTimestamp ( const QDateTime &  timestamp  ) 

Sets the item's log time.

Definition at line 60 of file LogTreeItem.cpp.

References COL_TIME, and DATETIME_FMT.

Referenced by LogTreeItem().

tc::Severity LogTreeItem::severity (  )  const

Returns the severity associated with this log item.

Definition at line 100 of file LogTreeItem.cpp.

References COL_TYPE, and ROLE_TYPE.

Referenced by LogTreeWidget::filter(), and operator<().

QString LogTreeItem::severityToString ( tc::Severity  severity  )  [static]

Converts a tc::Severity enum value to a localized string description.

Definition at line 121 of file LogTreeItem.cpp.

References tc::DebugSeverity, tc::ErrorSeverity, tc::InfoSeverity, tc::NoticeSeverity, and tc::WarnSeverity.

Referenced by setSeverity().

QDateTime LogTreeItem::timestamp (  )  const

Returns the timestamp for this log message.

Definition at line 107 of file LogTreeItem.cpp.

References COL_TIME, and DATETIME_FMT.

QString LogTreeItem::toString (  )  const

Returns a printable string representation of the item's contents.

Returns a printable string representing the fields of this item.

Definition at line 51 of file LogTreeItem.cpp.

References COL_MESG, COL_TIME, and COL_TYPE.

Referenced by LogTreeWidget::allMessages(), MessageLog::log(), and LogTreeWidget::selectedMessages().


Member Data Documentation

quint32 LogTreeItem::_seqnum [private]

Sequence number used to disambiguate messages with the same timestamp.

Definition at line 62 of file LogTreeItem.h.

Referenced by id(), LogTreeItem(), and operator<().


The documentation for this class was generated from the following files:
Generated on Mon Aug 30 23:09:54 2010 for Vidalia by  doxygen 1.6.3