summaryrefslogtreecommitdiffstats
path: root/src/sessiontreeitem.h
diff options
context:
space:
mode:
authorSimon Rettberg2016-01-20 16:43:34 +0100
committerSimon Rettberg2016-01-20 16:43:34 +0100
commit414c109d650a1014e7b84dfb66a00df420d67c97 (patch)
treeede0c5404aa408cd2bbb626312ed46383c7b13b6 /src/sessiontreeitem.h
parentRe-introduce tree structure: Allow server-defined sections (diff)
downloadvmchooser2-414c109d650a1014e7b84dfb66a00df420d67c97.tar.gz
vmchooser2-414c109d650a1014e7b84dfb66a00df420d67c97.tar.xz
vmchooser2-414c109d650a1014e7b84dfb66a00df420d67c97.zip
Remodel section handling: Use constants
Diffstat (limited to 'src/sessiontreeitem.h')
-rw-r--r--src/sessiontreeitem.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/sessiontreeitem.h b/src/sessiontreeitem.h
index a95fb45..6202b62 100644
--- a/src/sessiontreeitem.h
+++ b/src/sessiontreeitem.h
@@ -4,13 +4,14 @@
#include <QList>
#include <QVariant>
-// class ... instead of include?
#include "session.h"
+#include "globals.h"
#include <QString>
class SessionTreeItem {
public:
SessionTreeItem(const Session* session, SessionTreeItem *parent = 0);
+ SessionTreeItem(const SectionType type, SessionTreeItem *parent = 0);
SessionTreeItem(const QString& text, SessionTreeItem *parent = 0);
~SessionTreeItem();
@@ -19,17 +20,21 @@ class SessionTreeItem {
SessionTreeItem *child(int row);
int childCount() const;
- int columnCount() const;
+ int columnCount() const { return 1; }
int row() const;
SessionTreeItem *parent();
- const Session* session() const;
- const QString text() const;
+ const Session* session() const { return session_; }
+ const QString text() const { return text_; }
+ SectionType sectionType() const { return sectionType_; }
private:
QList<SessionTreeItem*> children_;
SessionTreeItem *parent_;
const Session *session_;
+ const SectionType sectionType_;
const QString text_;
+
+ static QString typeToName(const SectionType type);
};
#endif // SESSIONTREEITEM_H