From c69ca4df80c9c74aa842b7f1fb3c44b22ae3232e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 20 Mar 2019 07:31:24 -0700 Subject: Core: simplify ConnectionListModel The complicated setup with the AddressRole is unnecessary. All we want to be able to do is get the index of a specific text in the list. In hindsight I am puzzled why I implemented this in such a complex fashion. Signed-off-by: Dirk Hohndel --- core/connectionlistmodel.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'core/connectionlistmodel.h') diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h index 11a93bfbc..d6ffe831c 100644 --- a/core/connectionlistmodel.h +++ b/core/connectionlistmodel.h @@ -6,13 +6,8 @@ class ConnectionListModel : public QAbstractListModel { Q_OBJECT public: - enum CLMRole { - AddressRole = Qt::UserRole + 1 - }; ConnectionListModel(QObject *parent = 0); - QHash roleNames() const; - QVariant data(const QModelIndex &index, int role = AddressRole) const; - QString address(int idx) const; + QVariant data(const QModelIndex &index, int role) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; void addAddress(const QString address); void removeAllAddresses(); -- cgit v1.2.3-70-g09d2