summaryrefslogtreecommitdiffstats
path: root/core/connectionlistmodel.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-06 07:51:30 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-07 10:06:47 -0700
commit7aacaf60da7e73b9c57012e1846f709acb4d0ac2 (patch)
tree5dd0515de3f0bfebcc9f22a976089f8f2555b0f9 /core/connectionlistmodel.h
parent030c094854aeab4aaade523d7126728d9ce98a5b (diff)
downloadsubsurface-7aacaf60da7e73b9c57012e1846f709acb4d0ac2.tar.gz
Move ConnectionListModel into its own source file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/connectionlistmodel.h')
-rw-r--r--core/connectionlistmodel.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h
new file mode 100644
index 000000000..ec3a785fa
--- /dev/null
+++ b/core/connectionlistmodel.h
@@ -0,0 +1,22 @@
+#ifndef CONNECTIONLISTMODEL_H
+#define CONNECTIONLISTMODEL_H
+
+#include <QAbstractListModel>
+
+class ConnectionListModel : public QAbstractListModel {
+ Q_OBJECT
+public:
+ enum CLMRole {
+ AddressRole = Qt::UserRole + 1
+ };
+ ConnectionListModel(QObject *parent = 0);
+ QHash<int, QByteArray> roleNames() const;
+ QVariant data(const QModelIndex &index, int role = AddressRole) const;
+ QString address(int idx) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ void addAddress(const QString address);
+private:
+ QStringList m_addresses;
+};
+
+#endif