Use explicit keyword

This commit is contained in:
Laurent Montel
2023-07-12 13:18:32 +02:00
parent 10a294f99e
commit a5da17b000
11 changed files with 11 additions and 11 deletions

View File

@@ -28,7 +28,7 @@ class ColorSchemer : public QObject
Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT)
public:
ColorSchemer(QObject *parent = nullptr);
explicit ColorSchemer(QObject *parent = nullptr);
~ColorSchemer();
QAbstractItemModel *model() const;

View File

@@ -77,7 +77,7 @@ class DelegateSizeHelper : public QObject
Q_PROPERTY(qreal currentWidth READ currentWidth NOTIFY currentWidthChanged)
public:
DelegateSizeHelper(QObject *parent = nullptr);
explicit DelegateSizeHelper(QObject *parent = nullptr);
qreal parentWidth() const;
void setParentWidth(qreal parentWidth);

View File

@@ -78,7 +78,7 @@ public:
};
Q_ENUM(EventRoles)
RoomListModel(QObject *parent = nullptr);
explicit RoomListModel(QObject *parent = nullptr);
~RoomListModel() override;
[[nodiscard]] Quotient::Connection *connection() const;

View File

@@ -86,7 +86,7 @@ public:
SourceRole,
};
Q_ENUM(Roles);
SearchModel(QObject *parent = nullptr);
explicit SearchModel(QObject *parent = nullptr);
QString searchText() const;
void setSearchText(const QString &searchText);

View File

@@ -46,7 +46,7 @@ public:
IsDeletableRole, /**< Whether the item can be deleted from the model. */
};
ServerListModel(QObject *parent = nullptr);
explicit ServerListModel(QObject *parent = nullptr);
/**
* @brief Get the given role value at the given index.

View File

@@ -53,7 +53,7 @@ public:
};
Q_ENUM(RoomSortOrder)
SortFilterRoomListModel(QObject *parent = nullptr);
explicit SortFilterRoomListModel(QObject *parent = nullptr);
void setRoomSortOrder(RoomSortOrder sortOrder);
[[nodiscard]] RoomSortOrder roomSortOrder() const;

View File

@@ -31,7 +31,7 @@ public:
};
Q_ENUM(Roles);
StateModel(QObject *parent = nullptr);
explicit StateModel(QObject *parent = nullptr);
NeoChatRoom *room() const;
void setRoom(NeoChatRoom *room);

View File

@@ -53,7 +53,7 @@ public:
DirectChatsRole, /**< A list of direct chat matrix IDs with the user. */
};
UserDirectoryListModel(QObject *parent = nullptr);
explicit UserDirectoryListModel(QObject *parent = nullptr);
[[nodiscard]] Quotient::Connection *connection() const;
void setConnection(Quotient::Connection *conn);

View File

@@ -47,7 +47,7 @@ public:
};
Q_ENUM(EventRoles)
UserListModel(QObject *parent = nullptr);
explicit UserListModel(QObject *parent = nullptr);
[[nodiscard]] NeoChatRoom *room() const;
void setRoom(NeoChatRoom *room);

View File

@@ -85,7 +85,7 @@ public:
#endif
private:
NotificationsManager(QObject *parent = nullptr);
explicit NotificationsManager(QObject *parent = nullptr);
QHash<QString, qint64> m_initialTimestamp;
QHash<QString, QStringList> m_oldNotifications;

View File

@@ -16,7 +16,7 @@ class TrayIcon : public KStatusNotifierItem
{
Q_OBJECT
public:
TrayIcon(QObject *parent = nullptr);
explicit TrayIcon(QObject *parent = nullptr);
/**
* @brief Show the tray icon.