From 9f479b8f76238a03bce5d13aee14efd34e659c6e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sun, 30 Oct 2022 20:34:23 +0100 Subject: Clean up and modernize code - static "new-style" signal->slot connections - Fix a lot of things Clang-Tidy complained about - Move includes to .cpp files and use forward decls in .h - Don't use and , but specific includes instead --- src/client/connectwindow/connectwindow.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/client/connectwindow/connectwindow.h') diff --git a/src/client/connectwindow/connectwindow.h b/src/client/connectwindow/connectwindow.h index 2df672d..4a0ae7d 100644 --- a/src/client/connectwindow/connectwindow.h +++ b/src/client/connectwindow/connectwindow.h @@ -16,7 +16,7 @@ #ifndef PVSCONNECTWINDOW_H_ #define PVSCONNECTWINDOW_H_ -#include +#include #include #include #include @@ -56,10 +56,10 @@ public: }; explicit ConnectWindow(QWidget *parent = nullptr); - virtual ~ConnectWindow(); + ~ConnectWindow() override; - void connectToSession(const QByteArray sessionName, QString mgrIP); - void setAvailableRooms(QList m); + void connectToSession(const QByteArray& sessionName, const QString &mgrIP); + void setAvailableRooms(const QList& m); private: Ui::ConnectWindow *_ui; @@ -71,18 +71,17 @@ private: QString _currentIp; QString _defaultSessionName; NetworkMessage _packet; - bool _tryReconnect; + bool _tryReconnect{}; int _timerHide; void updateUserInterface(); protected: - void timerEvent(QTimerEvent* event); - void closeEvent(QCloseEvent *e); - void showEvent(QShowEvent* event); + void timerEvent(QTimerEvent* event) override; + void closeEvent(QCloseEvent *e) override; + void showEvent(QShowEvent* event) override; protected slots: - void doShow(); void onBtnConnection(); void onBtnHide(); @@ -92,13 +91,15 @@ protected slots: void onConnectionClosed(QObject* connection); void onConnectionDisconnected(ServerConnection* connection); // void onUdpReadyRead(); - void onServerDetected(const QString& host, const quint16 port, const QByteArray& sessionName, const QByteArray& certHash, bool autoConnect); + void onServerDetected(const QString& host, quint16 port, const QByteArray& sessionName, const QByteArray& certHash, bool autoConnect); public slots: /** actually connects the connection **/ void DoConnect(); /** actually disconnects the connection **/ void DoDisconnect(); + + void doShow(); signals: void disconnect(); void connected(ServerConnection* connection); -- cgit v1.2.3-55-g7522