summaryrefslogtreecommitdiffstats
path: root/src/sessiontreeitem.cpp
diff options
context:
space:
mode:
authorJan Darmochwal2010-10-07 16:56:12 +0200
committerJan Darmochwal2010-10-07 16:56:12 +0200
commite7e9cf2849d0000acf47ecde86e4853687a03409 (patch)
treeaa811c315fa49eccf3691f932ebbc8b28d67fa14 /src/sessiontreeitem.cpp
parentAdded files to parse command line options (diff)
downloadvmchooser-e7e9cf2849d0000acf47ecde86e4853687a03409.tar.gz
vmchooser-e7e9cf2849d0000acf47ecde86e4853687a03409.tar.xz
vmchooser-e7e9cf2849d0000acf47ecde86e4853687a03409.zip
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
Diffstat (limited to 'src/sessiontreeitem.cpp')
-rw-r--r--src/sessiontreeitem.cpp38
1 files changed, 14 insertions, 24 deletions
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<SessionTreeItem*>(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_;
}