summaryrefslogtreecommitdiffstats
path: root/core/connectionlistmodel.h
diff options
context:
space:
mode:
authorGravatar Rolf Eike Beer <eike@sf-mail.de>2019-03-22 21:25:59 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-03-27 07:36:33 -0700
commitbf9a526d63854f1ebb5bf102d54cc170f29ce370 (patch)
treecf5c1c06d8ef4f3f6d016f6186be16d2187522b3 /core/connectionlistmodel.h
parent5ad52db451102151b58b0e9b2af1adb80d16105d (diff)
downloadsubsurface-bf9a526d63854f1ebb5bf102d54cc170f29ce370.tar.gz
slightly optimize ConnectionListModel
-avoid object copies -use some more bullet proof C++11 constructs -avoid using a QRegExp, simple string matches are faster Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'core/connectionlistmodel.h')
-rw-r--r--core/connectionlistmodel.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h
index d6ffe831c..d05b753c7 100644
--- a/core/connectionlistmodel.h
+++ b/core/connectionlistmodel.h
@@ -6,12 +6,12 @@
class ConnectionListModel : public QAbstractListModel {
Q_OBJECT
public:
- ConnectionListModel(QObject *parent = 0);
- QVariant data(const QModelIndex &index, int role) const;
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
- void addAddress(const QString address);
+ ConnectionListModel(QObject *parent = nullptr);
+ QVariant data(const QModelIndex &index, int role) const override;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
+ void addAddress(const QString &address);
void removeAllAddresses();
- int indexOf(QString address);
+ int indexOf(const QString &address) const;
private:
QStringList m_addresses;
};