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 "\ ...@@ -25,6 +25,8 @@ set(CUSTOM_FLAGS "\
-Wpointer-arith \ -Wpointer-arith \
-Wuninitialized \ -Wuninitialized \
-Wunused \ -Wunused \
-Wsuggest-override \
-Werror=suggest-override \
") ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
......
...@@ -47,13 +47,13 @@ public: ...@@ -47,13 +47,13 @@ public:
ChatModel (QObject *parent = Q_NULLPTR) : QAbstractListModel(parent) {} 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; QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role) const; QVariant data (const QModelIndex &index, int role) const override;
bool removeRow (int row, const QModelIndex &parent = QModelIndex()); 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: public slots:
void removeEntry (int id); void removeEntry (int id);
......
...@@ -19,7 +19,7 @@ public: ...@@ -19,7 +19,7 @@ public:
ChatModelFilter (QObject *parent = Q_NULLPTR); ChatModelFilter (QObject *parent = Q_NULLPTR);
protected: protected:
bool filterAcceptsRow (int source_row, const QModelIndex &parent) const; bool filterAcceptsRow (int source_row, const QModelIndex &parent) const override;
private: private:
void setEntryTypeFilter (ChatModel::EntryType type); void setEntryTypeFilter (ChatModel::EntryType type);
...@@ -60,7 +60,7 @@ public slots: ...@@ -60,7 +60,7 @@ public slots:
} }
protected: protected:
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const; bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override;
private: private:
QString getSipAddress () const { QString getSipAddress () const {
......
...@@ -16,13 +16,13 @@ class ContactsListModel : public QAbstractListModel { ...@@ -16,13 +16,13 @@ class ContactsListModel : public QAbstractListModel {
public: public:
ContactsListModel (QObject *parent = Q_NULLPTR); 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; QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role) const; QVariant data (const QModelIndex &index, int role) const override;
bool removeRow (int row, const QModelIndex &parent = QModelIndex()); 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: public slots:
// See: http://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership // See: http://doc.qt.io/qt-5/qtqml-cppintegration-data.html#data-ownership
......
...@@ -30,8 +30,8 @@ public slots: ...@@ -30,8 +30,8 @@ public slots:
} }
protected: protected:
bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const; bool filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override;
bool lessThan (const QModelIndex &left, const QModelIndex &right) const; bool lessThan (const QModelIndex &left, const QModelIndex &right) const override;
private: private:
float computeStringWeight (const QString &string, float percentage) const; float computeStringWeight (const QString &string, float percentage) const;
......
...@@ -13,9 +13,9 @@ class TimelineModel : public QAbstractListModel { ...@@ -13,9 +13,9 @@ class TimelineModel : public QAbstractListModel {
public: public:
TimelineModel (const ContactsListModel *contacts_list); TimelineModel (const ContactsListModel *contacts_list);
int rowCount (const QModelIndex &) const; int rowCount (const QModelIndex &) const override;
QHash<int, QByteArray> roleNames () const; QHash<int, QByteArray> roleNames () const override;
QVariant data (const QModelIndex &index, int role) const; QVariant data (const QModelIndex &index, int role) const override;
private: private:
void init_entries (); void init_entries ();
......
...@@ -86,6 +86,7 @@ Window { ...@@ -86,6 +86,7 @@ Window {
childA: AbstractCall { childA: AbstractCall {
anchors.fill: parent anchors.fill: parent
callTypeLabel: 'INCOMING VIDEO CALL' callTypeLabel: 'INCOMING VIDEO CALL'
sipAddress: 'sip:erwan.croze@sip.linphone.org'
} }
childB: Rectangle { 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