diff --git a/include/ChatPage.h b/include/ChatPage.h index 67ddd1ed..f784231a 100644 --- a/include/ChatPage.h +++ b/include/ChatPage.h @@ -60,7 +60,6 @@ public: ChatPage(QSharedPointer client, QSharedPointer userSettings, QWidget *parent = 0); - ~ChatPage(); // Initialize all the components of the UI. void bootstrap(QString userid, QString homeserver, QString token); diff --git a/include/CommunitiesListItem.h b/include/CommunitiesListItem.h index 099b4fa2..c9272524 100644 --- a/include/CommunitiesListItem.h +++ b/include/CommunitiesListItem.h @@ -24,8 +24,6 @@ public: QString community_id, QWidget *parent = nullptr); - ~CommunitiesListItem(); - void setCommunity(QSharedPointer community); inline bool isPressed() const; @@ -87,7 +85,6 @@ class WorldCommunityListItem : public CommunitiesListItem Q_OBJECT public: WorldCommunityListItem(QWidget *parent = nullptr); - ~WorldCommunityListItem(); protected: void mousePressEvent(QMouseEvent *event) override; diff --git a/include/LoginPage.h b/include/LoginPage.h index a49e7911..f3ea16a1 100644 --- a/include/LoginPage.h +++ b/include/LoginPage.h @@ -35,7 +35,6 @@ class LoginPage : public QWidget public: LoginPage(QSharedPointer client, QWidget *parent = 0); - ~LoginPage(); void reset(); diff --git a/include/RegisterPage.h b/include/RegisterPage.h index 2d1d954b..b98e59de 100644 --- a/include/RegisterPage.h +++ b/include/RegisterPage.h @@ -32,7 +32,6 @@ class RegisterPage : public QWidget public: RegisterPage(QSharedPointer client, QWidget *parent = 0); - ~RegisterPage(); protected: void paintEvent(QPaintEvent *event) override; diff --git a/include/RoomInfoListItem.h b/include/RoomInfoListItem.h index 8222dc2b..4e3fe0ce 100644 --- a/include/RoomInfoListItem.h +++ b/include/RoomInfoListItem.h @@ -67,8 +67,6 @@ public: RoomInfoListItem(QString room_id, mtx::responses::InvitedRoom room, QWidget *parent = 0); - ~RoomInfoListItem(); - void updateUnreadMessageCount(int count); void clearUnreadMessageCount(); void setState(QSharedPointer state) diff --git a/include/RoomList.h b/include/RoomList.h index b99b354f..7ceffd22 100644 --- a/include/RoomList.h +++ b/include/RoomList.h @@ -44,7 +44,6 @@ public: RoomList(QSharedPointer client, QSharedPointer userSettings, QWidget *parent = 0); - ~RoomList(); void setCache(QSharedPointer cache) { cache_ = cache; } void setInitialRooms(const std::map> &settings, diff --git a/include/SideBarActions.h b/include/SideBarActions.h index 5d3c6170..4b3be213 100644 --- a/include/SideBarActions.h +++ b/include/SideBarActions.h @@ -19,7 +19,6 @@ class SideBarActions : public QWidget public: SideBarActions(QWidget *parent = nullptr); - ~SideBarActions(); signals: void showSettings(); diff --git a/include/TextInputWidget.h b/include/TextInputWidget.h index c7cb06c5..6d28009e 100644 --- a/include/TextInputWidget.h +++ b/include/TextInputWidget.h @@ -80,7 +80,6 @@ class TextInputWidget : public QWidget public: TextInputWidget(QWidget *parent = 0); - ~TextInputWidget(); void stopTyping(); diff --git a/include/TopRoomBar.h b/include/TopRoomBar.h index 2ee25361..5b9c58e9 100644 --- a/include/TopRoomBar.h +++ b/include/TopRoomBar.h @@ -41,7 +41,6 @@ class TopRoomBar : public QWidget Q_OBJECT public: TopRoomBar(QWidget *parent = 0); - ~TopRoomBar(); void updateRoomAvatar(const QImage &avatar_image); void updateRoomAvatar(const QIcon &icon); diff --git a/include/UserInfoWidget.h b/include/UserInfoWidget.h index 3c20380f..cae9d5b9 100644 --- a/include/UserInfoWidget.h +++ b/include/UserInfoWidget.h @@ -32,7 +32,6 @@ class UserInfoWidget : public QWidget public: UserInfoWidget(QWidget *parent = 0); - ~UserInfoWidget(); void setAvatar(const QImage &img); void setDisplayName(const QString &name); diff --git a/include/emoji/Category.h b/include/emoji/Category.h index d60e11fe..a14029c8 100644 --- a/include/emoji/Category.h +++ b/include/emoji/Category.h @@ -32,7 +32,6 @@ class Category : public QWidget public: Category(QString category, std::vector emoji, QWidget *parent = nullptr); - ~Category(); signals: void emojiSelected(const QString &emoji); diff --git a/include/timeline/TimelineItem.h b/include/timeline/TimelineItem.h index c499957b..793b9067 100644 --- a/include/timeline/TimelineItem.h +++ b/include/timeline/TimelineItem.h @@ -86,8 +86,6 @@ public: void setEventId(const QString &event_id) { event_id_ = event_id; } void markReceived(); - ~TimelineItem(); - protected: void paintEvent(QPaintEvent *event) override; void contextMenuEvent(QContextMenuEvent *event) override; diff --git a/include/timeline/TimelineViewManager.h b/include/timeline/TimelineViewManager.h index 81fedfb2..e3cc311e 100644 --- a/include/timeline/TimelineViewManager.h +++ b/include/timeline/TimelineViewManager.h @@ -35,7 +35,6 @@ class TimelineViewManager : public QStackedWidget public: TimelineViewManager(QSharedPointer client, QWidget *parent); - ~TimelineViewManager(); // Initialize with timeline events. void initialize(const mtx::responses::Rooms &rooms); diff --git a/include/ui/Avatar.h b/include/ui/Avatar.h index d856b9d8..41967af5 100644 --- a/include/ui/Avatar.h +++ b/include/ui/Avatar.h @@ -16,7 +16,6 @@ class Avatar : public QWidget public: explicit Avatar(QWidget *parent = 0); - ~Avatar(); void setBackgroundColor(const QColor &color); void setIcon(const QIcon &icon); diff --git a/include/ui/Badge.h b/include/ui/Badge.h index 4084247e..fd73ad30 100644 --- a/include/ui/Badge.h +++ b/include/ui/Badge.h @@ -19,7 +19,6 @@ public: explicit Badge(QWidget *parent = 0); explicit Badge(const QIcon &icon, QWidget *parent = 0); explicit Badge(const QString &text, QWidget *parent = 0); - ~Badge(); void setBackgroundColor(const QColor &color); void setTextColor(const QColor &color); diff --git a/include/ui/Label.h b/include/ui/Label.h index 66e98115..09cf27d7 100644 --- a/include/ui/Label.h +++ b/include/ui/Label.h @@ -11,7 +11,6 @@ public: explicit Label(const QString &text, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); - ~Label() override {} signals: void clicked(QMouseEvent *e); diff --git a/include/ui/Ripple.h b/include/ui/Ripple.h index 0baebfd6..9184f061 100644 --- a/include/ui/Ripple.h +++ b/include/ui/Ripple.h @@ -18,7 +18,6 @@ class Ripple : public QParallelAnimationGroup public: explicit Ripple(const QPoint ¢er, QObject *parent = 0); Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0); - ~Ripple(); inline void setOverlay(RippleOverlay *overlay); diff --git a/include/ui/RippleOverlay.h b/include/ui/RippleOverlay.h index 28a6b9e4..9ef91fbf 100644 --- a/include/ui/RippleOverlay.h +++ b/include/ui/RippleOverlay.h @@ -12,7 +12,6 @@ class RippleOverlay : public OverlayWidget public: explicit RippleOverlay(QWidget *parent = 0); - ~RippleOverlay(); void addRipple(Ripple *ripple); void addRipple(const QPoint &position, qreal radius = 300); diff --git a/include/ui/SnackBar.h b/include/ui/SnackBar.h index 8a35c327..bb579e92 100644 --- a/include/ui/SnackBar.h +++ b/include/ui/SnackBar.h @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include "OverlayWidget.h" @@ -19,7 +19,6 @@ class SnackBar : public OverlayWidget public: explicit SnackBar(QWidget *parent); - ~SnackBar(); inline void setBackgroundColor(const QColor &color); inline void setTextColor(const QColor &color); @@ -48,8 +47,8 @@ private: QList messages_; - QTimer *showTimer_; - QTimer *hideTimer_; + QSharedPointer showTimer_; + QSharedPointer hideTimer_; int duration_; int boxWidth_; diff --git a/include/ui/TextField.h b/include/ui/TextField.h index 3682fbd2..1675a2e0 100644 --- a/include/ui/TextField.h +++ b/include/ui/TextField.h @@ -23,7 +23,6 @@ class TextField : public QLineEdit public: explicit TextField(QWidget *parent = 0); - ~TextField(); void setInkColor(const QColor &color); void setBackgroundColor(const QColor &color); @@ -72,7 +71,6 @@ class TextFieldLabel : public QWidget public: TextFieldLabel(TextField *parent); - ~TextFieldLabel(); inline void setColor(const QColor &color); inline void setOffset(const QPointF &pos); @@ -140,7 +138,6 @@ class TextFieldStateMachine : public QStateMachine public: TextFieldStateMachine(TextField *parent); - ~TextFieldStateMachine(); inline void setProgress(qreal progress); void setLabel(TextFieldLabel *label); diff --git a/include/ui/Theme.h b/include/ui/Theme.h index c2e4ab59..0ce5ef04 100644 --- a/include/ui/Theme.h +++ b/include/ui/Theme.h @@ -84,7 +84,6 @@ class Theme : public QObject Q_OBJECT public: explicit Theme(QObject *parent = 0); - ~Theme(); QColor getColor(const QString &key) const; diff --git a/src/ChatPage.cc b/src/ChatPage.cc index ba7e2797..64368da2 100644 --- a/src/ChatPage.cc +++ b/src/ChatPage.cc @@ -988,5 +988,3 @@ ChatPage::retryInitialSync() client_->initialSync(); initialSyncTimer_->start(INITIAL_SYNC_RETRY_TIMEOUT); } - -ChatPage::~ChatPage() {} diff --git a/src/CommunitiesListItem.cc b/src/CommunitiesListItem.cc index a7789df7..5aedfcbc 100644 --- a/src/CommunitiesListItem.cc +++ b/src/CommunitiesListItem.cc @@ -13,8 +13,6 @@ CommunitiesListItem::CommunitiesListItem(QSharedPointer community, setFixedWidth(ui::sidebar::CommunitiesSidebarSize); } -CommunitiesListItem::~CommunitiesListItem() {} - void CommunitiesListItem::setCommunity(QSharedPointer community) { @@ -150,8 +148,6 @@ WorldCommunityListItem::WorldCommunityListItem(QWidget *parent) : CommunitiesListItem(QSharedPointer(), "", parent) {} -WorldCommunityListItem::~WorldCommunityListItem() {} - void WorldCommunityListItem::mousePressEvent(QMouseEvent *event) { diff --git a/src/LoginPage.cc b/src/LoginPage.cc index ef665b39..fca1ec68 100644 --- a/src/LoginPage.cc +++ b/src/LoginPage.cc @@ -295,5 +295,3 @@ LoginPage::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } - -LoginPage::~LoginPage() {} diff --git a/src/RegisterPage.cc b/src/RegisterPage.cc index 28d0a8a4..9165680b 100644 --- a/src/RegisterPage.cc +++ b/src/RegisterPage.cc @@ -177,5 +177,3 @@ RegisterPage::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } - -RegisterPage::~RegisterPage() {} diff --git a/src/RoomInfoListItem.cc b/src/RoomInfoListItem.cc index 3388e5d7..45ee6148 100644 --- a/src/RoomInfoListItem.cc +++ b/src/RoomInfoListItem.cc @@ -388,5 +388,3 @@ RoomInfoListItem::setDescriptionMessage(const DescInfo &info) lastMsgInfo_ = info; update(); } - -RoomInfoListItem::~RoomInfoListItem() {} diff --git a/src/RoomList.cc b/src/RoomList.cc index 099e5b1c..1f8747ae 100644 --- a/src/RoomList.cc +++ b/src/RoomList.cc @@ -73,8 +73,6 @@ RoomList::RoomList(QSharedPointer client, }); } -RoomList::~RoomList() {} - void RoomList::clear() { diff --git a/src/SideBarActions.cc b/src/SideBarActions.cc index 7c4cebbd..904184f1 100644 --- a/src/SideBarActions.cc +++ b/src/SideBarActions.cc @@ -116,8 +116,6 @@ SideBarActions::SideBarActions(QWidget *parent) connect(settingsBtn_, &QPushButton::clicked, this, &SideBarActions::showSettings); } -SideBarActions::~SideBarActions() {} - void SideBarActions::resizeEvent(QResizeEvent *event) { diff --git a/src/TextInputWidget.cc b/src/TextInputWidget.cc index 755145c5..239f9d54 100644 --- a/src/TextInputWidget.cc +++ b/src/TextInputWidget.cc @@ -401,8 +401,6 @@ TextInputWidget::hideUploadSpinner() spinner_->stop(); } -TextInputWidget::~TextInputWidget() {} - void TextInputWidget::stopTyping() { diff --git a/src/TopRoomBar.cc b/src/TopRoomBar.cc index d3ae307f..f676a4d8 100644 --- a/src/TopRoomBar.cc +++ b/src/TopRoomBar.cc @@ -233,5 +233,3 @@ TopRoomBar::updateRoomTopic(QString topic) roomTopic_ = topic; update(); } - -TopRoomBar::~TopRoomBar() {} diff --git a/src/UserInfoWidget.cc b/src/UserInfoWidget.cc index fe0c2b56..77aed5d5 100644 --- a/src/UserInfoWidget.cc +++ b/src/UserInfoWidget.cc @@ -119,8 +119,6 @@ UserInfoWidget::closeLogoutDialog(bool isLoggingOut) emit logout(); } -UserInfoWidget::~UserInfoWidget() {} - void UserInfoWidget::resizeEvent(QResizeEvent *event) { diff --git a/src/emoji/Category.cc b/src/emoji/Category.cc index a0d838c0..c1b526f2 100644 --- a/src/emoji/Category.cc +++ b/src/emoji/Category.cc @@ -88,5 +88,3 @@ Category::paintEvent(QPaintEvent *) QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } - -Category::~Category() {} diff --git a/src/timeline/TimelineItem.cc b/src/timeline/TimelineItem.cc index 62e195a4..7756ba4a 100644 --- a/src/timeline/TimelineItem.cc +++ b/src/timeline/TimelineItem.cc @@ -497,8 +497,6 @@ TimelineItem::setUserAvatar(const QImage &avatar) userAvatar_->setImage(avatar); } -TimelineItem::~TimelineItem() {} - void TimelineItem::contextMenuEvent(QContextMenuEvent *event) { diff --git a/src/timeline/TimelineViewManager.cc b/src/timeline/TimelineViewManager.cc index 7318ce2b..fdc3b9e2 100644 --- a/src/timeline/TimelineViewManager.cc +++ b/src/timeline/TimelineViewManager.cc @@ -45,8 +45,6 @@ TimelineViewManager::TimelineViewManager(QSharedPointer client, QW &TimelineViewManager::messageSendFailed); } -TimelineViewManager::~TimelineViewManager() {} - void TimelineViewManager::messageSent(const QString &event_id, const QString &roomid, int txn_id) { diff --git a/src/ui/Avatar.cc b/src/ui/Avatar.cc index 17ee198e..81e6cbed 100644 --- a/src/ui/Avatar.cc +++ b/src/ui/Avatar.cc @@ -17,8 +17,6 @@ Avatar::Avatar(QWidget *parent) setSizePolicy(policy); } -Avatar::~Avatar() {} - QColor Avatar::textColor() const { diff --git a/src/ui/Badge.cc b/src/ui/Badge.cc index 016ed64f..6701f9b7 100644 --- a/src/ui/Badge.cc +++ b/src/ui/Badge.cc @@ -22,8 +22,6 @@ Badge::Badge(const QString &text, QWidget *parent) setText(text); } -Badge::~Badge() {} - void Badge::init() { diff --git a/src/ui/Ripple.cc b/src/ui/Ripple.cc index 008d7a6a..e22c4a62 100644 --- a/src/ui/Ripple.cc +++ b/src/ui/Ripple.cc @@ -25,8 +25,6 @@ Ripple::Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent) init(); } -Ripple::~Ripple() {} - void Ripple::setRadius(qreal radius) { diff --git a/src/ui/RippleOverlay.cc b/src/ui/RippleOverlay.cc index a3567db2..20e98c0f 100644 --- a/src/ui/RippleOverlay.cc +++ b/src/ui/RippleOverlay.cc @@ -11,8 +11,6 @@ RippleOverlay::RippleOverlay(QWidget *parent) setAttribute(Qt::WA_NoSystemBackground); } -RippleOverlay::~RippleOverlay() {} - void RippleOverlay::addRipple(Ripple *ripple) { diff --git a/src/ui/SnackBar.cc b/src/ui/SnackBar.cc index fb415fcd..1f02ee95 100644 --- a/src/ui/SnackBar.cc +++ b/src/ui/SnackBar.cc @@ -23,20 +23,12 @@ SnackBar::SnackBar(QWidget *parent) font.setWeight(50); setFont(font); - showTimer_ = new QTimer(); - hideTimer_ = new QTimer(); + showTimer_ = QSharedPointer(new QTimer); + hideTimer_ = QSharedPointer(new QTimer); hideTimer_->setSingleShot(true); - connect(showTimer_, SIGNAL(timeout()), this, SLOT(onTimeout())); - connect(hideTimer_, SIGNAL(timeout()), this, SLOT(hideMessage())); -} - -SnackBar::~SnackBar() -{ - stopTimers(); - - delete showTimer_; - delete hideTimer_; + connect(showTimer_.data(), SIGNAL(timeout()), this, SLOT(onTimeout())); + connect(hideTimer_.data(), SIGNAL(timeout()), this, SLOT(hideMessage())); } void diff --git a/src/ui/TextField.cc b/src/ui/TextField.cc index 9b410ae5..0c936e69 100644 --- a/src/ui/TextField.cc +++ b/src/ui/TextField.cc @@ -32,8 +32,6 @@ TextField::TextField(QWidget *parent) QCoreApplication::processEvents(); } -TextField::~TextField() {} - void TextField::setBackgroundColor(const QColor &color) { @@ -273,8 +271,6 @@ TextFieldStateMachine::TextFieldStateMachine(TextField *parent) connect(text_field_, SIGNAL(textChanged(QString)), this, SLOT(setupProperties())); } -TextFieldStateMachine::~TextFieldStateMachine() {} - void TextFieldStateMachine::setLabel(TextFieldLabel *label) { @@ -350,8 +346,6 @@ TextFieldLabel::TextFieldLabel(TextField *parent) setFont(font); } -TextFieldLabel::~TextFieldLabel() {} - void TextFieldLabel::paintEvent(QPaintEvent *) { diff --git a/src/ui/Theme.cc b/src/ui/Theme.cc index 622428b0..7209864a 100644 --- a/src/ui/Theme.cc +++ b/src/ui/Theme.cc @@ -22,8 +22,6 @@ Theme::Theme(QObject *parent) setColor("Transparent", ui::Color::Transparent); } -Theme::~Theme() {} - QColor Theme::rgba(int r, int g, int b, qreal a) const {