Mark classes as final where possible

This commit is contained in:
Nicolas Werner 2022-10-10 14:38:29 +02:00
parent 00cc9a09a5
commit af699eb83e
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
51 changed files with 72 additions and 72 deletions

View file

@ -11,7 +11,7 @@
#include "CacheStructs.h" #include "CacheStructs.h"
class FetchPublishedAliasesJob : public QObject class FetchPublishedAliasesJob final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -26,7 +26,7 @@ signals:
void advertizedAliasesFetched(std::vector<std::string> aliases); void advertizedAliasesFetched(std::vector<std::string> aliases);
}; };
class AliasEditingModel : public QAbstractListModel class AliasEditingModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool canAdvertize READ canAdvertize CONSTANT) Q_PROPERTY(bool canAdvertize READ canAdvertize CONSTANT)

View file

@ -11,7 +11,7 @@
using AvatarCallback = std::function<void(QPixmap)>; using AvatarCallback = std::function<void(QPixmap)>;
class AvatarProxy : public QObject class AvatarProxy final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -11,7 +11,7 @@
#include <QImage> #include <QImage>
#include <QThreadPool> #include <QThreadPool>
class BlurhashRunnable class BlurhashRunnable final
: public QObject : public QObject
, public QRunnable , public QRunnable
{ {
@ -33,7 +33,7 @@ private:
QSize m_requestedSize; QSize m_requestedSize;
}; };
class BlurhashResponse : public QQuickImageResponse class BlurhashResponse final : public QQuickImageResponse
{ {
public: public:
BlurhashResponse(const QString &id, const QSize &requestedSize) BlurhashResponse(const QString &id, const QSize &requestedSize)

View file

@ -33,7 +33,7 @@ namespace mtx::responses {
struct Messages; struct Messages;
} }
class Cache : public QObject class Cache final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -48,7 +48,7 @@ struct Rooms;
using SecretsToDecrypt = std::map<std::string, mtx::secret_storage::AesHmacSha2EncryptedData>; using SecretsToDecrypt = std::map<std::string, mtx::secret_storage::AesHmacSha2EncryptedData>;
class ChatPage : public QObject class ChatPage final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -8,7 +8,7 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
class Clipboard : public QObject class Clipboard final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)

View file

@ -5,7 +5,7 @@
#include <QQuickImageProvider> #include <QQuickImageProvider>
class ColorImageProvider : public QQuickImageProvider class ColorImageProvider final : public QQuickImageProvider
{ {
public: public:
ColorImageProvider() ColorImageProvider()

View file

@ -9,7 +9,7 @@
#include <mtx/events/mscs/image_packs.hpp> #include <mtx/events/mscs/image_packs.hpp>
class CombinedImagePackModel : public QAbstractListModel class CombinedImagePackModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
public: public:

View file

@ -156,7 +156,7 @@ struct trie
} }
}; };
class CompletionProxyModel : public QAbstractProxyModel class CompletionProxyModel final : public QAbstractProxyModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString searchString READ searchString WRITE setSearchString NOTIFY newSearchString) Q_PROPERTY(QString searchString READ searchString WRITE setSearchString NOTIFY newSearchString)

View file

@ -10,7 +10,7 @@
#include <QSharedPointer> #include <QSharedPointer>
class SingleImagePackModel; class SingleImagePackModel;
class ImagePackListModel : public QAbstractListModel class ImagePackListModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool containsAccountPack READ containsAccountPack CONSTANT) Q_PROPERTY(bool containsAccountPack READ containsAccountPack CONSTANT)

View file

@ -9,7 +9,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QVector> #include <QVector>
class Invitee : public QObject class Invitee final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -27,7 +27,7 @@ private:
friend class InviteesModel; friend class InviteesModel;
}; };
class InviteesModel : public QAbstractListModel class InviteesModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT

View file

@ -14,7 +14,7 @@
#include "jdenticoninterface.h" #include "jdenticoninterface.h"
class JdenticonRunnable class JdenticonRunnable final
: public QObject : public QObject
, public QRunnable , public QRunnable
{ {
@ -34,7 +34,7 @@ private:
QSize m_requestedSize; QSize m_requestedSize;
}; };
class JdenticonResponse : public QQuickImageResponse class JdenticonResponse final : public QQuickImageResponse
{ {
public: public:
JdenticonResponse(const QString &key, bool crop, double radius, const QSize &requestedSize); JdenticonResponse(const QString &key, bool crop, double radius, const QSize &requestedSize);

View file

@ -39,7 +39,7 @@ class MemberList;
class ReCaptcha; class ReCaptcha;
} }
class MainWindow : public QQuickView class MainWindow final : public QQuickView
{ {
Q_OBJECT Q_OBJECT

View file

@ -12,7 +12,7 @@
#include "CacheStructs.h" #include "CacheStructs.h"
class MemberListBackend : public QAbstractListModel class MemberListBackend final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
@ -77,7 +77,7 @@ private:
friend class MemberList; friend class MemberList;
}; };
class MemberList : public QSortFilterProxyModel class MemberList final : public QSortFilterProxyModel
{ {
Q_OBJECT Q_OBJECT

View file

@ -14,7 +14,7 @@
#include <mtx/common.hpp> #include <mtx/common.hpp>
class MxcImageRunnable : public QObject class MxcImageRunnable final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -38,7 +38,7 @@ public:
bool m_crop; bool m_crop;
double m_radius; double m_radius;
}; };
class MxcImageResponse : public QQuickImageResponse class MxcImageResponse final : public QQuickImageResponse
{ {
public: public:
MxcImageResponse(const QString &id, bool crop, double radius, const QSize &requestedSize) MxcImageResponse(const QString &id, bool crop, double radius, const QSize &requestedSize)

View file

@ -11,7 +11,7 @@
#include "CacheStructs.h" #include "CacheStructs.h"
class PowerlevelsTypeListModel : public QAbstractListModel class PowerlevelsTypeListModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
@ -68,7 +68,7 @@ public:
mtx::events::state::PowerLevels powerLevels_; mtx::events::state::PowerLevels powerLevels_;
}; };
class PowerlevelsUserListModel : public QAbstractListModel class PowerlevelsUserListModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
@ -122,7 +122,7 @@ public:
mtx::events::state::PowerLevels powerLevels_; mtx::events::state::PowerLevels powerLevels_;
}; };
class PowerlevelsSpacesListModel : public QAbstractListModel class PowerlevelsSpacesListModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool applyToChildren READ applyToChildren WRITE setApplyToChildren NOTIFY Q_PROPERTY(bool applyToChildren READ applyToChildren WRITE setApplyToChildren NOTIFY
@ -192,7 +192,7 @@ public:
bool applyToChildren_ = true, overwriteDiverged_ = false; bool applyToChildren_ = true, overwriteDiverged_ = false;
}; };
class PowerlevelEditingModels : public QObject class PowerlevelEditingModels final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -12,7 +12,7 @@
#include <QSortFilterProxyModel> #include <QSortFilterProxyModel>
#include <QString> #include <QString>
class ReadReceiptsModel : public QAbstractListModel class ReadReceiptsModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
@ -51,7 +51,7 @@ private:
QVector<QPair<QString, QDateTime>> readReceipts_; QVector<QPair<QString, QDateTime>> readReceipts_;
}; };
class ReadReceiptsProxy : public QSortFilterProxyModel class ReadReceiptsProxy final : public QSortFilterProxyModel
{ {
Q_OBJECT Q_OBJECT

View file

@ -10,7 +10,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QString> #include <QString>
class RoomsModel : public QAbstractListModel class RoomsModel final : public QAbstractListModel
{ {
public: public:
enum Roles enum Roles

View file

@ -8,7 +8,7 @@
#include <QObject> #include <QObject>
#include <string> #include <string>
class SSOHandler : public QObject class SSOHandler final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -13,7 +13,7 @@
#include "CacheStructs.h" #include "CacheStructs.h"
class SingleImagePackModel : public QAbstractListModel class SingleImagePackModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT

View file

@ -14,7 +14,7 @@
class QAction; class QAction;
class QPainter; class QPainter;
class MsgCountComposedIcon : public QIconEngine class MsgCountComposedIcon final : public QIconEngine
{ {
public: public:
MsgCountComposedIcon(const QString &filename); MsgCountComposedIcon(const QString &filename);
@ -36,7 +36,7 @@ private:
QIcon icon_; QIcon icon_;
}; };
class TrayIcon : public QSystemTrayIcon class TrayIcon final : public QSystemTrayIcon
{ {
Q_OBJECT Q_OBJECT
public: public:

View file

@ -26,7 +26,7 @@ constexpr int OptionMargin = 6;
constexpr int LayoutTopMargin = 50; constexpr int LayoutTopMargin = 50;
constexpr int LayoutBottomMargin = LayoutTopMargin; constexpr int LayoutBottomMargin = LayoutTopMargin;
class UserSettings : public QObject class UserSettings final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -393,7 +393,7 @@ private:
static QSharedPointer<UserSettings> instance_; static QSharedPointer<UserSettings> instance_;
}; };
class UserSettingsModel : public QAbstractListModel class UserSettingsModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT

View file

@ -7,7 +7,7 @@
#include <QAbstractListModel> #include <QAbstractListModel>
class UsersModel : public QAbstractListModel class UsersModel final : public QAbstractListModel
{ {
public: public:
enum Roles enum Roles

View file

@ -25,7 +25,7 @@ const QVersionNumber dbusApiVersion{1, 0, 0};
bool bool
apiVersionIsCompatible(const QVersionNumber &clientAppVersion); apiVersionIsCompatible(const QVersionNumber &clientAppVersion);
class RoomInfoItem : public QObject class RoomInfoItem final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -13,7 +13,7 @@
class RoomlistModel; class RoomlistModel;
class NhekoDBusBackend : public QObject class NhekoDBusBackend final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "im.nheko.Nheko") Q_CLASSINFO("D-Bus Interface", "im.nheko.Nheko")

View file

@ -12,7 +12,7 @@ class QLabel;
namespace dialogs { namespace dialogs {
class FallbackAuth : public QWidget class FallbackAuth final : public QWidget
{ {
Q_OBJECT Q_OBJECT

View file

@ -11,7 +11,7 @@ class QPushButton;
namespace dialogs { namespace dialogs {
class ReCaptcha : public QWidget class ReCaptcha final : public QWidget
{ {
Q_OBJECT Q_OBJECT

View file

@ -10,7 +10,7 @@
#include <QtDBus/QDBusInterface> #include <QtDBus/QDBusInterface>
#endif #endif
class Dock : public QObject class Dock final : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View file

@ -61,7 +61,7 @@ using sas_ptr = std::unique_ptr<mtx::crypto::SAS>;
* We are the bigger mxid and deviceid (since we discard our start message). <- GLARE RESOLUTION * We are the bigger mxid and deviceid (since we discard our start message). <- GLARE RESOLUTION
*/ */
// clang-format on // clang-format on
class DeviceVerificationFlow : public QObject class DeviceVerificationFlow final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString state READ state NOTIFY stateChanged) Q_PROPERTY(QString state READ state NOTIFY stateChanged)

View file

@ -7,7 +7,7 @@
#include <QObject> #include <QObject>
class SelfVerificationStatus : public QObject class SelfVerificationStatus final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -18,7 +18,7 @@ class TimelineModel;
class TimelineViewManager; class TimelineViewManager;
class RoomlistModel; class RoomlistModel;
class VerificationManager : public QObject class VerificationManager final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -28,7 +28,7 @@ operator==(const roomEventId &a, const roomEventId &b)
return a.roomId == b.roomId && a.eventId == b.eventId; return a.roomId == b.roomId && a.eventId == b.eventId;
} }
class NotificationsManager : public QObject class NotificationsManager final : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View file

@ -19,7 +19,7 @@
class CommunitiesModel; class CommunitiesModel;
class FilteredCommunitiesModel : public QSortFilterProxyModel class FilteredCommunitiesModel final : public QSortFilterProxyModel
{ {
Q_OBJECT Q_OBJECT
@ -71,7 +71,7 @@ public:
bool canEditParent = false, canEditChild = false; bool canEditParent = false, canEditChild = false;
}; };
class CommunitiesModel : public QAbstractListModel class CommunitiesModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString currentTagId READ currentTagId WRITE setCurrentTagId NOTIFY Q_PROPERTY(QString currentTagId READ currentTagId WRITE setCurrentTagId NOTIFY

View file

@ -69,7 +69,7 @@ signals:
void childChanged(); void childChanged();
private: private:
struct DelegateIncubator : public QQmlIncubator struct DelegateIncubator final : public QQmlIncubator
{ {
DelegateIncubator(DelegateChooser &parent) DelegateIncubator(DelegateChooser &parent)
: QQmlIncubator(QQmlIncubator::AsynchronousIfNested) : QQmlIncubator(QQmlIncubator::AsynchronousIfNested)

View file

@ -19,7 +19,7 @@
#include "Reaction.h" #include "Reaction.h"
#include "encryption/Olm.h" #include "encryption/Olm.h"
class EventStore : public QObject class EventStore final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -41,7 +41,7 @@ enum class MarkdownOverride
OFF, OFF,
}; };
class InputVideoSurface : public QAbstractVideoSurface class InputVideoSurface final : public QAbstractVideoSurface
{ {
Q_OBJECT Q_OBJECT
@ -60,7 +60,7 @@ signals:
void newImage(QImage img); void newImage(QImage img);
}; };
class MediaUpload : public QObject class MediaUpload final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int mediaType READ type NOTIFY mediaTypeChanged) Q_PROPERTY(int mediaType READ type NOTIFY mediaTypeChanged)
@ -168,7 +168,7 @@ public:
bool encrypt_; bool encrypt_;
}; };
class InputBar : public QObject class InputBar final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool uploading READ uploading NOTIFY uploadingChanged) Q_PROPERTY(bool uploading READ uploading NOTIFY uploadingChanged)

View file

@ -11,7 +11,7 @@
class TimelineModel; class TimelineModel;
class Permissions : public QObject class Permissions final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -12,7 +12,7 @@
#include <mtx/events.hpp> #include <mtx/events.hpp>
#include <mtx/events/presence.hpp> #include <mtx/events/presence.hpp>
class PresenceEmitter : public QObject class PresenceEmitter final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -46,7 +46,7 @@ public:
bool isInvite_ = false; bool isInvite_ = false;
}; };
class RoomlistModel : public QAbstractListModel class RoomlistModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY( Q_PROPERTY(
@ -152,7 +152,7 @@ private:
friend class FilteredRoomlistModel; friend class FilteredRoomlistModel;
}; };
class FilteredRoomlistModel : public QSortFilterProxyModel class FilteredRoomlistModel final : public QSortFilterProxyModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY( Q_PROPERTY(

View file

@ -171,7 +171,7 @@ struct DecryptionResult
class TimelineViewManager; class TimelineViewManager;
class TimelineModel : public QAbstractListModel class TimelineModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)

View file

@ -34,7 +34,7 @@ namespace mtx::responses {
struct Sync; struct Sync;
} }
class TimelineViewManager : public QObject class TimelineViewManager final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -16,7 +16,7 @@
#include "Theme.h" #include "Theme.h"
#include "UserProfile.h" #include "UserProfile.h"
class Nheko : public QObject class Nheko final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -19,7 +19,7 @@
/// Convenience class which connects events emmited from threads /// Convenience class which connects events emmited from threads
/// outside of main with the UI code. /// outside of main with the UI code.
class ThreadProxy : public QObject class ThreadProxy final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -32,7 +32,7 @@ signals:
class RoomSettings; class RoomSettings;
class RoomSettingsAllowedRoomsModel : public QAbstractListModel class RoomSettingsAllowedRoomsModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
@ -67,7 +67,7 @@ private:
RoomSettings *settings; RoomSettings *settings;
}; };
class RoomSettings : public QObject class RoomSettings final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString roomId READ roomId CONSTANT) Q_PROPERTY(QString roomId READ roomId CONSTANT)

View file

@ -10,7 +10,7 @@
#include <mtx/responses/public_rooms.hpp> #include <mtx/responses/public_rooms.hpp>
class RoomSummaryProxy : public QObject class RoomSummaryProxy final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -21,7 +21,7 @@ signals:
void failed(); void failed();
}; };
class RoomSummary : public QObject class RoomSummary final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -8,7 +8,7 @@
#include <QColor> #include <QColor>
#include <QPalette> #include <QPalette>
class Theme : public QPalette class Theme final : public QPalette
{ {
Q_GADGET Q_GADGET
Q_PROPERTY(QColor sidebarBackground READ sidebarBackground CONSTANT) Q_PROPERTY(QColor sidebarBackground READ sidebarBackground CONSTANT)

View file

@ -7,7 +7,7 @@
#include <QCommonStyle> #include <QCommonStyle>
class ThemeManager : public QCommonStyle class ThemeManager final : public QCommonStyle
{ {
Q_OBJECT Q_OBJECT

View file

@ -9,7 +9,7 @@
#include <mtxclient/http/client.hpp> #include <mtxclient/http/client.hpp>
class UIA : public QObject class UIA final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -32,7 +32,7 @@ Q_ENUM_NS(Status)
class DeviceVerificationFlow; class DeviceVerificationFlow;
class TimelineViewManager; class TimelineViewManager;
class UserProfileFetchProxy : public QObject class UserProfileFetchProxy final : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -83,7 +83,7 @@ public:
qlonglong lastTs; qlonglong lastTs;
}; };
class DeviceInfoModel : public QAbstractListModel class DeviceInfoModel final : public QAbstractListModel
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -120,7 +120,7 @@ private:
friend class UserProfile; friend class UserProfile;
}; };
class UserProfile : public QObject class UserProfile final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(QString displayName READ displayName NOTIFY displayNameChanged) Q_PROPERTY(QString displayName READ displayName NOTIFY displayNameChanged)

View file

@ -13,7 +13,7 @@
typedef struct _GstDevice GstDevice; typedef struct _GstDevice GstDevice;
class CallDevices : public QObject class CallDevices final : public QObject
{ {
Q_OBJECT Q_OBJECT

View file

@ -25,7 +25,7 @@ struct TurnServer;
class QUrl; class QUrl;
class CallManager : public QObject class CallManager final : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool haveCallInvite READ haveCallInvite NOTIFY newInviteState) Q_PROPERTY(bool haveCallInvite READ haveCallInvite NOTIFY newInviteState)

View file

@ -42,7 +42,7 @@ enum class State
Q_ENUM_NS(State) Q_ENUM_NS(State)
} }
class WebRTCSession : public QObject class WebRTCSession final : public QObject
{ {
Q_OBJECT Q_OBJECT