Remove empty destructors

This commit is contained in:
Konstantinos Sideris 2018-02-10 16:29:09 +02:00
parent 26f221ec23
commit ba8faa357f
41 changed files with 7 additions and 86 deletions

View File

@ -60,7 +60,6 @@ public:
ChatPage(QSharedPointer<MatrixClient> client,
QSharedPointer<UserSettings> userSettings,
QWidget *parent = 0);
~ChatPage();
// Initialize all the components of the UI.
void bootstrap(QString userid, QString homeserver, QString token);

View File

@ -24,8 +24,6 @@ public:
QString community_id,
QWidget *parent = nullptr);
~CommunitiesListItem();
void setCommunity(QSharedPointer<Community> 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;

View File

@ -35,7 +35,6 @@ class LoginPage : public QWidget
public:
LoginPage(QSharedPointer<MatrixClient> client, QWidget *parent = 0);
~LoginPage();
void reset();

View File

@ -32,7 +32,6 @@ class RegisterPage : public QWidget
public:
RegisterPage(QSharedPointer<MatrixClient> client, QWidget *parent = 0);
~RegisterPage();
protected:
void paintEvent(QPaintEvent *event) override;

View File

@ -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<RoomState> state)

View File

@ -44,7 +44,6 @@ public:
RoomList(QSharedPointer<MatrixClient> client,
QSharedPointer<UserSettings> userSettings,
QWidget *parent = 0);
~RoomList();
void setCache(QSharedPointer<Cache> cache) { cache_ = cache; }
void setInitialRooms(const std::map<QString, QSharedPointer<RoomSettings>> &settings,

View File

@ -19,7 +19,6 @@ class SideBarActions : public QWidget
public:
SideBarActions(QWidget *parent = nullptr);
~SideBarActions();
signals:
void showSettings();

View File

@ -80,7 +80,6 @@ class TextInputWidget : public QWidget
public:
TextInputWidget(QWidget *parent = 0);
~TextInputWidget();
void stopTyping();

View File

@ -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);

View File

@ -32,7 +32,6 @@ class UserInfoWidget : public QWidget
public:
UserInfoWidget(QWidget *parent = 0);
~UserInfoWidget();
void setAvatar(const QImage &img);
void setDisplayName(const QString &name);

View File

@ -32,7 +32,6 @@ class Category : public QWidget
public:
Category(QString category, std::vector<Emoji> emoji, QWidget *parent = nullptr);
~Category();
signals:
void emojiSelected(const QString &emoji);

View File

@ -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;

View File

@ -35,7 +35,6 @@ class TimelineViewManager : public QStackedWidget
public:
TimelineViewManager(QSharedPointer<MatrixClient> client, QWidget *parent);
~TimelineViewManager();
// Initialize with timeline events.
void initialize(const mtx::responses::Rooms &rooms);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -18,7 +18,6 @@ class Ripple : public QParallelAnimationGroup
public:
explicit Ripple(const QPoint &center, QObject *parent = 0);
Ripple(const QPoint &center, RippleOverlay *overlay, QObject *parent = 0);
~Ripple();
inline void setOverlay(RippleOverlay *overlay);

View File

@ -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);

View File

@ -2,7 +2,7 @@
#include <QCoreApplication>
#include <QPaintEvent>
#include <QStateMachine>
#include <QSharedPointer>
#include <QTimer>
#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<QString> messages_;
QTimer *showTimer_;
QTimer *hideTimer_;
QSharedPointer<QTimer> showTimer_;
QSharedPointer<QTimer> hideTimer_;
int duration_;
int boxWidth_;

View File

@ -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);

View File

@ -84,7 +84,6 @@ class Theme : public QObject
Q_OBJECT
public:
explicit Theme(QObject *parent = 0);
~Theme();
QColor getColor(const QString &key) const;

View File

@ -988,5 +988,3 @@ ChatPage::retryInitialSync()
client_->initialSync();
initialSyncTimer_->start(INITIAL_SYNC_RETRY_TIMEOUT);
}
ChatPage::~ChatPage() {}

View File

@ -13,8 +13,6 @@ CommunitiesListItem::CommunitiesListItem(QSharedPointer<Community> community,
setFixedWidth(ui::sidebar::CommunitiesSidebarSize);
}
CommunitiesListItem::~CommunitiesListItem() {}
void
CommunitiesListItem::setCommunity(QSharedPointer<Community> community)
{
@ -150,8 +148,6 @@ WorldCommunityListItem::WorldCommunityListItem(QWidget *parent)
: CommunitiesListItem(QSharedPointer<Community>(), "", parent)
{}
WorldCommunityListItem::~WorldCommunityListItem() {}
void
WorldCommunityListItem::mousePressEvent(QMouseEvent *event)
{

View File

@ -295,5 +295,3 @@ LoginPage::paintEvent(QPaintEvent *)
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
LoginPage::~LoginPage() {}

View File

@ -177,5 +177,3 @@ RegisterPage::paintEvent(QPaintEvent *)
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
RegisterPage::~RegisterPage() {}

View File

@ -388,5 +388,3 @@ RoomInfoListItem::setDescriptionMessage(const DescInfo &info)
lastMsgInfo_ = info;
update();
}
RoomInfoListItem::~RoomInfoListItem() {}

View File

@ -73,8 +73,6 @@ RoomList::RoomList(QSharedPointer<MatrixClient> client,
});
}
RoomList::~RoomList() {}
void
RoomList::clear()
{

View File

@ -116,8 +116,6 @@ SideBarActions::SideBarActions(QWidget *parent)
connect(settingsBtn_, &QPushButton::clicked, this, &SideBarActions::showSettings);
}
SideBarActions::~SideBarActions() {}
void
SideBarActions::resizeEvent(QResizeEvent *event)
{

View File

@ -401,8 +401,6 @@ TextInputWidget::hideUploadSpinner()
spinner_->stop();
}
TextInputWidget::~TextInputWidget() {}
void
TextInputWidget::stopTyping()
{

View File

@ -233,5 +233,3 @@ TopRoomBar::updateRoomTopic(QString topic)
roomTopic_ = topic;
update();
}
TopRoomBar::~TopRoomBar() {}

View File

@ -119,8 +119,6 @@ UserInfoWidget::closeLogoutDialog(bool isLoggingOut)
emit logout();
}
UserInfoWidget::~UserInfoWidget() {}
void
UserInfoWidget::resizeEvent(QResizeEvent *event)
{

View File

@ -88,5 +88,3 @@ Category::paintEvent(QPaintEvent *)
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
Category::~Category() {}

View File

@ -497,8 +497,6 @@ TimelineItem::setUserAvatar(const QImage &avatar)
userAvatar_->setImage(avatar);
}
TimelineItem::~TimelineItem() {}
void
TimelineItem::contextMenuEvent(QContextMenuEvent *event)
{

View File

@ -45,8 +45,6 @@ TimelineViewManager::TimelineViewManager(QSharedPointer<MatrixClient> client, QW
&TimelineViewManager::messageSendFailed);
}
TimelineViewManager::~TimelineViewManager() {}
void
TimelineViewManager::messageSent(const QString &event_id, const QString &roomid, int txn_id)
{

View File

@ -17,8 +17,6 @@ Avatar::Avatar(QWidget *parent)
setSizePolicy(policy);
}
Avatar::~Avatar() {}
QColor
Avatar::textColor() const
{

View File

@ -22,8 +22,6 @@ Badge::Badge(const QString &text, QWidget *parent)
setText(text);
}
Badge::~Badge() {}
void
Badge::init()
{

View File

@ -25,8 +25,6 @@ Ripple::Ripple(const QPoint &center, RippleOverlay *overlay, QObject *parent)
init();
}
Ripple::~Ripple() {}
void
Ripple::setRadius(qreal radius)
{

View File

@ -11,8 +11,6 @@ RippleOverlay::RippleOverlay(QWidget *parent)
setAttribute(Qt::WA_NoSystemBackground);
}
RippleOverlay::~RippleOverlay() {}
void
RippleOverlay::addRipple(Ripple *ripple)
{

View File

@ -23,20 +23,12 @@ SnackBar::SnackBar(QWidget *parent)
font.setWeight(50);
setFont(font);
showTimer_ = new QTimer();
hideTimer_ = new QTimer();
showTimer_ = QSharedPointer<QTimer>(new QTimer);
hideTimer_ = QSharedPointer<QTimer>(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

View File

@ -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 *)
{

View File

@ -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
{