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"
class FetchPublishedAliasesJob : public QObject
class FetchPublishedAliasesJob final : public QObject
{
Q_OBJECT
@ -26,7 +26,7 @@ signals:
void advertizedAliasesFetched(std::vector<std::string> aliases);
};
class AliasEditingModel : public QAbstractListModel
class AliasEditingModel final : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(bool canAdvertize READ canAdvertize CONSTANT)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
#include <QtDBus/QDBusInterface>
#endif
class Dock : public QObject
class Dock final : public QObject
{
Q_OBJECT
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
*/
// clang-format on
class DeviceVerificationFlow : public QObject
class DeviceVerificationFlow final : public QObject
{
Q_OBJECT
Q_PROPERTY(QString state READ state NOTIFY stateChanged)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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