Commit 7bcc90c3 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): force the usage of `override` keyword

parent 989bbc4e
......@@ -25,6 +25,8 @@ set(CUSTOM_FLAGS "\
-Wpointer-arith \
-Wuninitialized \
-Wunused \
-Wsuggest-override \
-Werror=suggest-override \
")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
......
......@@ -47,13 +47,13 @@ public:
ChatModel (QObject *parent = Q_NULLPTR) : QAbstractListModel(parent) {}
int rowCount (const QModelIndex &index = QModelIndex()) const;
int rowCount (const QModelIndex &index = QModelIndex()) const override;
QHash<int, QByteArray> roleNames () const;
QVariant data (const QModelIndex &index, int role) const;
QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role) const override;
bool removeRow (int row, const QModelIndex &parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex()) override;
public slots:
void removeEntry (int id);
......
......@@ -19,7 +19,7 @@ public:
ChatModelFilter (QObject *parent = Q_NULLPTR);
protected:
bool filterAcceptsRow (int source_row, const QModelIndex &parent) const;
bool filterAcceptsRow (int source_row, const QModelIndex &parent) const override;
private:
void setEntryTypeFilter (ChatModel::EntryType type);
......@@ -60,7 +60,7 @@ public slots:
}
protected:
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const;
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override;
private:
QString getSipAddress () const {
......
......@@ -16,13 +16,13 @@ class ContactsListModel : public QAbstractListModel {
public:
ContactsListModel (QObject *parent = Q_NULLPTR);
int rowCount (const QModelIndex &index = QModelIndex()) const;
int rowCount (const QModelIndex &index = QModelIndex()) const override;
QHash<int, QByteArray> roleNames () const;
QVariant data (const QModelIndex &index, int role) const;
QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role) const override;
bool removeRow (int row, const QModelIndex &parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex());
bool removeRows (int row, int count, const QModelIndex &parent = QModelIndex()) override;
public slots:
// See: http://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership
......
......@@ -30,8 +30,8 @@ public slots:
}
protected:
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const;
bool lessThan (const QModelIndex &left, const QModelIndex &right) const;
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override;
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override;
private:
float computeStringWeight (const QString &string, float percentage) const;
......
......@@ -13,9 +13,9 @@ class TimelineModel : public QAbstractListModel {
public:
TimelineModel (const ContactsListModel *contacts_list);
int rowCount (const QModelIndex &) const;
QHash<int, QByteArray> roleNames () const;
QVariant data (const QModelIndex &index, int role) const;
int rowCount (const QModelIndex &) const override;
QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role) const override;
private:
void init_entries ();
......
......@@ -86,6 +86,7 @@ Window {
childA: AbstractCall {
anchors.fill: parent
callTypeLabel: 'INCOMING VIDEO CALL'
sipAddress: 'sip:erwan.croze@sip.linphone.org'
}
childB: Rectangle {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment