From e7e9cf2849d0000acf47ecde86e4853687a03409 Mon Sep 17 00:00:00 2001 From: Jan Darmochwal Date: Thu, 7 Oct 2010 16:56:12 +0200 Subject: Tidy up the code * fixed compiler warnings, added -Werror to CMakeLists.txt * removed LibXml2 and boost stuff from CMakeLists.txt * fixed some things cpplint.py complains about: * make single-argument constructors explicit * add space before if/for/while/... * don't put { on a line of its own * remove space after ! operator * add space between // and comment * remove extra space before ( in function call * remove extra space before ) * shorten lines to <= 80 characters * remove blank lines at the start of a code block * maybe others --- src/sessiontreeitem.cpp | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) (limited to 'src/sessiontreeitem.cpp') diff --git a/src/sessiontreeitem.cpp b/src/sessiontreeitem.cpp index 5e07ad4..45a4774 100644 --- a/src/sessiontreeitem.cpp +++ b/src/sessiontreeitem.cpp @@ -1,47 +1,39 @@ #include "sessiontreeitem.h" -SessionTreeItem::SessionTreeItem(const Session* session, SessionTreeItem *parent) : - parent_(parent), session_(session) -{ +SessionTreeItem::SessionTreeItem(const Session* session, + SessionTreeItem *parent) + : parent_(parent), session_(session) { } -SessionTreeItem::SessionTreeItem(const QString& text, SessionTreeItem *parent) : - parent_(parent), session_(NULL), text_(text) -{ +SessionTreeItem::SessionTreeItem(const QString& text, SessionTreeItem *parent) + : parent_(parent), session_(NULL), text_(text) { } -SessionTreeItem::~SessionTreeItem() -{ +SessionTreeItem::~SessionTreeItem() { qDeleteAll(children_); } -void SessionTreeItem::appendChild(SessionTreeItem *item) -{ +void SessionTreeItem::appendChild(SessionTreeItem *item) { children_.append(item); } -SessionTreeItem *SessionTreeItem::child(int row) -{ +SessionTreeItem *SessionTreeItem::child(int row) { return children_.value(row); } -int SessionTreeItem::childCount() const -{ +int SessionTreeItem::childCount() const { return children_.count(); } -int SessionTreeItem::columnCount() const -{ +int SessionTreeItem::columnCount() const { return 1; } -SessionTreeItem *SessionTreeItem::parent() -{ +SessionTreeItem *SessionTreeItem::parent() { return parent_; } -int SessionTreeItem::row() const -{ +int SessionTreeItem::row() const { if (parent_) { return parent_->children_.indexOf(const_cast(this)); } @@ -49,12 +41,10 @@ int SessionTreeItem::row() const return 0; } -const Session* SessionTreeItem::session() const -{ +const Session* SessionTreeItem::session() const { return session_; } -const QString SessionTreeItem::text() const -{ +const QString SessionTreeItem::text() const { return text_; } -- cgit v1.2.3-55-g7522