mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
modernize: use nullptr
This commit is contained in:
parent
d330020fdd
commit
7ccc120f63
29 changed files with 43 additions and 43 deletions
|
@ -65,7 +65,7 @@ class ChatPage : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent = 0);
|
ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent = nullptr);
|
||||||
|
|
||||||
// Initialize all the components of the UI.
|
// Initialize all the components of the UI.
|
||||||
void bootstrap(QString userid, QString homeserver, QString token);
|
void bootstrap(QString userid, QString homeserver, QString token);
|
||||||
|
|
|
@ -111,7 +111,7 @@ LoginPage::LoginPage(QWidget *parent)
|
||||||
|
|
||||||
form_layout_->addLayout(matrixidLayout_);
|
form_layout_->addLayout(matrixidLayout_);
|
||||||
form_layout_->addWidget(password_input_);
|
form_layout_->addWidget(password_input_);
|
||||||
form_layout_->addWidget(deviceName_, Qt::AlignHCenter, 0);
|
form_layout_->addWidget(deviceName_, Qt::AlignHCenter, nullptr);
|
||||||
form_layout_->addLayout(serverLayout_);
|
form_layout_->addLayout(serverLayout_);
|
||||||
|
|
||||||
button_layout_ = new QHBoxLayout();
|
button_layout_ = new QHBoxLayout();
|
||||||
|
|
|
@ -38,7 +38,7 @@ class LoginPage : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LoginPage(QWidget *parent = 0);
|
LoginPage(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ class MainWindow : public QMainWindow
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QWidget *parent = 0);
|
explicit MainWindow(QWidget *parent = nullptr);
|
||||||
|
|
||||||
static MainWindow *instance() { return instance_; };
|
static MainWindow *instance() { return instance_; };
|
||||||
void saveCurrentWindowSize();
|
void saveCurrentWindowSize();
|
||||||
|
|
|
@ -90,10 +90,10 @@ RegisterPage::RegisterPage(QWidget *parent)
|
||||||
server_input_ = new TextField();
|
server_input_ = new TextField();
|
||||||
server_input_->setLabel(tr("Home Server"));
|
server_input_->setLabel(tr("Home Server"));
|
||||||
|
|
||||||
form_layout_->addWidget(username_input_, Qt::AlignHCenter, 0);
|
form_layout_->addWidget(username_input_, Qt::AlignHCenter, nullptr);
|
||||||
form_layout_->addWidget(password_input_, Qt::AlignHCenter, 0);
|
form_layout_->addWidget(password_input_, Qt::AlignHCenter, nullptr);
|
||||||
form_layout_->addWidget(password_confirmation_, Qt::AlignHCenter, 0);
|
form_layout_->addWidget(password_confirmation_, Qt::AlignHCenter, nullptr);
|
||||||
form_layout_->addWidget(server_input_, Qt::AlignHCenter, 0);
|
form_layout_->addWidget(server_input_, Qt::AlignHCenter, nullptr);
|
||||||
|
|
||||||
button_layout_ = new QHBoxLayout();
|
button_layout_ = new QHBoxLayout();
|
||||||
button_layout_->setSpacing(0);
|
button_layout_->setSpacing(0);
|
||||||
|
|
|
@ -30,7 +30,7 @@ class RegisterPage : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RegisterPage(QWidget *parent = 0);
|
RegisterPage(QWidget *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent *event) override;
|
||||||
|
|
|
@ -65,7 +65,7 @@ class RoomInfoListItem : public QWidget
|
||||||
Q_PROPERTY(QColor btnTextColor READ btnTextColor WRITE setBtnTextColor)
|
Q_PROPERTY(QColor btnTextColor READ btnTextColor WRITE setBtnTextColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RoomInfoListItem(QString room_id, const RoomInfo &info, QWidget *parent = 0);
|
RoomInfoListItem(QString room_id, const RoomInfo &info, QWidget *parent = nullptr);
|
||||||
|
|
||||||
void updateUnreadMessageCount(int count, int highlightedCount);
|
void updateUnreadMessageCount(int count, int highlightedCount);
|
||||||
void clearUnreadMessageCount() { updateUnreadMessageCount(0, 0); };
|
void clearUnreadMessageCount() { updateUnreadMessageCount(0, 0); };
|
||||||
|
|
|
@ -35,7 +35,7 @@ class RoomList : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RoomList(QWidget *parent = 0);
|
explicit RoomList(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void initialize(const QMap<QString, RoomInfo> &info);
|
void initialize(const QMap<QString, RoomInfo> &info);
|
||||||
void sync(const std::map<QString, RoomInfo> &info);
|
void sync(const std::map<QString, RoomInfo> &info);
|
||||||
|
|
|
@ -142,7 +142,7 @@ class TextInputWidget : public QWidget
|
||||||
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TextInputWidget(QWidget *parent = 0);
|
TextInputWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void stopTyping();
|
void stopTyping();
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class TopRoomBar : public QWidget
|
||||||
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TopRoomBar(QWidget *parent = 0);
|
TopRoomBar(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void updateRoomAvatar(const QString &avatar_image);
|
void updateRoomAvatar(const QString &avatar_image);
|
||||||
void updateRoomAvatar(const QIcon &icon);
|
void updateRoomAvatar(const QIcon &icon);
|
||||||
|
|
|
@ -31,7 +31,7 @@ class UserInfoWidget : public QWidget
|
||||||
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UserInfoWidget(QWidget *parent = 0);
|
UserInfoWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void setDisplayName(const QString &name);
|
void setDisplayName(const QString &name);
|
||||||
void setUserId(const QString &userid);
|
void setUserId(const QString &userid);
|
||||||
|
|
|
@ -147,7 +147,7 @@ class UserSettingsPage : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
UserSettingsPage(QSharedPointer<UserSettings> settings, QWidget *parent = 0);
|
UserSettingsPage(QSharedPointer<UserSettings> settings, QWidget *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *event) override;
|
void showEvent(QShowEvent *event) override;
|
||||||
|
|
|
@ -7,7 +7,7 @@ class WelcomePage : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WelcomePage(QWidget *parent = 0);
|
explicit WelcomePage(QWidget *parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *) override;
|
void paintEvent(QPaintEvent *) override;
|
||||||
|
|
|
@ -32,7 +32,7 @@ ImageOverlay::ImageOverlay(QPixmap image, QWidget *parent)
|
||||||
, originalImage_{image}
|
, originalImage_{image}
|
||||||
{
|
{
|
||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
setParent(0);
|
setParent(nullptr);
|
||||||
|
|
||||||
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
|
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
|
|
||||||
ReplyPopup::ReplyPopup(QWidget *parent)
|
ReplyPopup::ReplyPopup(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, userItem_{0}
|
, userItem_{nullptr}
|
||||||
, msgLabel_{0}
|
, msgLabel_{nullptr}
|
||||||
, eventLabel_{0}
|
, eventLabel_{nullptr}
|
||||||
{
|
{
|
||||||
setAttribute(Qt::WA_ShowWithoutActivating, true);
|
setAttribute(Qt::WA_ShowWithoutActivating, true);
|
||||||
setWindowFlags(Qt::ToolTip | Qt::NoDropShadowWindowHint);
|
setWindowFlags(Qt::ToolTip | Qt::NoDropShadowWindowHint);
|
||||||
|
|
|
@ -59,7 +59,7 @@ private:
|
||||||
size_t posToRemove = layout_->count() - 1;
|
size_t posToRemove = layout_->count() - 1;
|
||||||
|
|
||||||
QLayoutItem *item;
|
QLayoutItem *item;
|
||||||
while (startingPos <= posToRemove && (item = layout_->takeAt(posToRemove)) != 0) {
|
while (startingPos <= posToRemove && (item = layout_->takeAt(posToRemove)) != nullptr) {
|
||||||
delete item->widget();
|
delete item->widget();
|
||||||
delete item;
|
delete item;
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ class TimelineModel : public QAbstractListModel
|
||||||
typingUsersChanged)
|
typingUsersChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TimelineModel(TimelineViewManager *manager, QString room_id, QObject *parent = 0);
|
explicit TimelineModel(TimelineViewManager *manager, QString room_id, QObject *parent = nullptr);
|
||||||
|
|
||||||
enum Roles
|
enum Roles
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ class TimelineViewManager : public QObject
|
||||||
replyingEventChanged)
|
replyingEventChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TimelineViewManager(QSharedPointer<UserSettings> userSettings, QWidget *parent = 0);
|
TimelineViewManager(QSharedPointer<UserSettings> userSettings, QWidget *parent = nullptr);
|
||||||
QWidget *getWidget() const { return container; }
|
QWidget *getWidget() const { return container; }
|
||||||
|
|
||||||
void sync(const mtx::responses::Rooms &rooms);
|
void sync(const mtx::responses::Rooms &rooms);
|
||||||
|
|
|
@ -15,7 +15,7 @@ class Avatar : public QWidget
|
||||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Avatar(QWidget *parent = 0, int size = ui::AvatarSize);
|
explicit Avatar(QWidget *parent = nullptr, int size = ui::AvatarSize);
|
||||||
|
|
||||||
void setBackgroundColor(const QColor &color);
|
void setBackgroundColor(const QColor &color);
|
||||||
void setIcon(const QIcon &icon);
|
void setIcon(const QIcon &icon);
|
||||||
|
|
|
@ -16,9 +16,9 @@ class Badge : public OverlayWidget
|
||||||
Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition)
|
Q_PROPERTY(QPointF relativePosition WRITE setRelativePosition READ relativePosition)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Badge(QWidget *parent = 0);
|
explicit Badge(QWidget *parent = nullptr);
|
||||||
explicit Badge(const QIcon &icon, QWidget *parent = 0);
|
explicit Badge(const QIcon &icon, QWidget *parent = nullptr);
|
||||||
explicit Badge(const QString &text, QWidget *parent = 0);
|
explicit Badge(const QString &text, QWidget *parent = nullptr);
|
||||||
|
|
||||||
void setBackgroundColor(const QColor &color);
|
void setBackgroundColor(const QColor &color);
|
||||||
void setTextColor(const QColor &color);
|
void setTextColor(const QColor &color);
|
||||||
|
|
|
@ -91,14 +91,14 @@ class FlatButton : public QPushButton
|
||||||
Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize)
|
Q_PROPERTY(qreal fontSize WRITE setFontSize READ fontSize)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FlatButton(QWidget *parent = 0,
|
explicit FlatButton(QWidget *parent = nullptr,
|
||||||
ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
|
ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
|
||||||
explicit FlatButton(const QString &text,
|
explicit FlatButton(const QString &text,
|
||||||
QWidget *parent = 0,
|
QWidget *parent = nullptr,
|
||||||
ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
|
ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
|
||||||
FlatButton(const QString &text,
|
FlatButton(const QString &text,
|
||||||
ui::Role role,
|
ui::Role role,
|
||||||
QWidget *parent = 0,
|
QWidget *parent = nullptr,
|
||||||
ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
|
ui::ButtonPreset preset = ui::ButtonPreset::FlatPreset);
|
||||||
~FlatButton();
|
~FlatButton();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ class LoadingIndicator : public QWidget
|
||||||
Q_PROPERTY(QColor color READ color WRITE setColor)
|
Q_PROPERTY(QColor color READ color WRITE setColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LoadingIndicator(QWidget *parent = 0);
|
LoadingIndicator(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void paintEvent(QPaintEvent *e);
|
void paintEvent(QPaintEvent *e);
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@ class RaisedButton : public FlatButton
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RaisedButton(QWidget *parent = 0);
|
explicit RaisedButton(QWidget *parent = nullptr);
|
||||||
explicit RaisedButton(const QString &text, QWidget *parent = 0);
|
explicit RaisedButton(const QString &text, QWidget *parent = nullptr);
|
||||||
~RaisedButton();
|
~RaisedButton();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
Ripple::Ripple(const QPoint ¢er, QObject *parent)
|
Ripple::Ripple(const QPoint ¢er, QObject *parent)
|
||||||
: QParallelAnimationGroup(parent)
|
: QParallelAnimationGroup(parent)
|
||||||
, overlay_(0)
|
, overlay_(nullptr)
|
||||||
, radius_anim_(animate("radius"))
|
, radius_anim_(animate("radius"))
|
||||||
, opacity_anim_(animate("opacity"))
|
, opacity_anim_(animate("opacity"))
|
||||||
, radius_(0)
|
, radius_(0)
|
||||||
|
|
|
@ -16,8 +16,8 @@ class Ripple : public QParallelAnimationGroup
|
||||||
Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
|
Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Ripple(const QPoint ¢er, QObject *parent = 0);
|
explicit Ripple(const QPoint ¢er, QObject *parent = nullptr);
|
||||||
Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = 0);
|
Ripple(const QPoint ¢er, RippleOverlay *overlay, QObject *parent = nullptr);
|
||||||
|
|
||||||
inline void setOverlay(RippleOverlay *overlay);
|
inline void setOverlay(RippleOverlay *overlay);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ class RippleOverlay : public OverlayWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RippleOverlay(QWidget *parent = 0);
|
explicit RippleOverlay(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void addRipple(Ripple *ripple);
|
void addRipple(Ripple *ripple);
|
||||||
void addRipple(const QPoint &position, qreal radius = 300);
|
void addRipple(const QPoint &position, qreal radius = 300);
|
||||||
|
|
|
@ -16,7 +16,7 @@ TextField::TextField(QWidget *parent)
|
||||||
QPalette pal;
|
QPalette pal;
|
||||||
|
|
||||||
state_machine_ = new TextFieldStateMachine(this);
|
state_machine_ = new TextFieldStateMachine(this);
|
||||||
label_ = 0;
|
label_ = nullptr;
|
||||||
label_font_size_ = 15;
|
label_font_size_ = 15;
|
||||||
show_label_ = false;
|
show_label_ = false;
|
||||||
background_color_ = pal.color(QPalette::Window);
|
background_color_ = pal.color(QPalette::Window);
|
||||||
|
@ -230,9 +230,9 @@ TextFieldStateMachine::TextFieldStateMachine(TextField *parent)
|
||||||
normal_state_ = new QState;
|
normal_state_ = new QState;
|
||||||
focused_state_ = new QState;
|
focused_state_ = new QState;
|
||||||
|
|
||||||
label_ = 0;
|
label_ = nullptr;
|
||||||
offset_anim_ = 0;
|
offset_anim_ = nullptr;
|
||||||
color_anim_ = 0;
|
color_anim_ = nullptr;
|
||||||
progress_ = 0.0;
|
progress_ = 0.0;
|
||||||
|
|
||||||
addState(normal_state_);
|
addState(normal_state_);
|
||||||
|
|
|
@ -22,7 +22,7 @@ class TextField : public QLineEdit
|
||||||
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
Q_PROPERTY(QColor backgroundColor WRITE setBackgroundColor READ backgroundColor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TextField(QWidget *parent = 0);
|
explicit TextField(QWidget *parent = nullptr);
|
||||||
|
|
||||||
void setInkColor(const QColor &color);
|
void setInkColor(const QColor &color);
|
||||||
void setBackgroundColor(const QColor &color);
|
void setBackgroundColor(const QColor &color);
|
||||||
|
|
|
@ -78,7 +78,7 @@ class Theme : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Theme(QObject *parent = 0);
|
explicit Theme(QObject *parent = nullptr);
|
||||||
|
|
||||||
QColor getColor(const QString &key) const;
|
QColor getColor(const QString &key) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue