From c82254aa9e75114d53e3b90870e624c305220c8e Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 7 Apr 2018 12:53:10 +0200 Subject: [PATCH] Reformat Remove some UUID remnants --- src/widgets/notebook.cpp | 2 +- src/widgets/split.hpp | 8 ++++---- src/widgets/splitcontainer.cpp | 9 +++------ src/widgets/splitcontainer.hpp | 24 ++++++++++++------------ src/widgets/streamview.cpp | 4 +--- src/widgets/streamview.hpp | 2 +- 6 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/widgets/notebook.cpp b/src/widgets/notebook.cpp index b1d7d3501..3faa0409e 100644 --- a/src/widgets/notebook.cpp +++ b/src/widgets/notebook.cpp @@ -103,7 +103,7 @@ void Notebook::removePage(SplitContainer *page) this->pages.removeOne(page); - if (this->pages.size() == 0) { + if (this->pages.empty()) { this->addNewPage(); } diff --git a/src/widgets/split.hpp b/src/widgets/split.hpp index f5195a549..e4a51be03 100644 --- a/src/widgets/split.hpp +++ b/src/widgets/split.hpp @@ -74,11 +74,11 @@ public: void drag(); protected: - void paintEvent(QPaintEvent *) override; - void mouseMoveEvent(QMouseEvent *) override; + void paintEvent(QPaintEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override; - void keyPressEvent(QKeyEvent *) override; - void keyReleaseEvent(QKeyEvent *) override; + void keyPressEvent(QKeyEvent *event) override; + void keyReleaseEvent(QKeyEvent *event) override; private: SplitContainer &parentPage; diff --git a/src/widgets/splitcontainer.cpp b/src/widgets/splitcontainer.cpp index 265625c9f..de37c6050 100644 --- a/src/widgets/splitcontainer.cpp +++ b/src/widgets/splitcontainer.cpp @@ -212,12 +212,9 @@ NotebookTab *SplitContainer::getTab() const return this->tab; } -void SplitContainer::addChat(bool openChannelNameDialog, std::string chatUUID) +void SplitContainer::addChat(bool openChannelNameDialog) { - if (chatUUID.empty()) { - chatUUID = CreateUUID().toStdString(); - } - Split *w = this->createChatWidget(chatUUID); + Split *w = this->createChatWidget(); if (openChannelNameDialog) { bool ret = w->showChangeChannelPopup("Open channel name", true); @@ -505,7 +502,7 @@ std::pair SplitContainer::getChatPosition(const Split *chatWidget) return getWidgetPositionInLayout(layout, chatWidget); } -Split *SplitContainer::createChatWidget(const std::string &uuid) +Split *SplitContainer::createChatWidget() { auto split = new Split(this); diff --git a/src/widgets/splitcontainer.hpp b/src/widgets/splitcontainer.hpp index 44093c8ae..e2cef4d87 100644 --- a/src/widgets/splitcontainer.hpp +++ b/src/widgets/splitcontainer.hpp @@ -29,7 +29,7 @@ public: std::vector> getColumns() const; NotebookTab *getTab() const; - void addChat(bool openChannelNameDialog = false, std::string chatUUID = std::string()); + void addChat(bool openChannelNameDialog = false); static bool isDraggingSplit; static Split *draggingSplit; @@ -46,19 +46,19 @@ public: int splitCount() const; protected: - virtual bool eventFilter(QObject *object, QEvent *event) override; - virtual void paintEvent(QPaintEvent *) override; + bool eventFilter(QObject *object, QEvent *event) override; + void paintEvent(QPaintEvent *event) override; - virtual void showEvent(QShowEvent *) override; + void showEvent(QShowEvent *event) override; - virtual void enterEvent(QEvent *) override; - virtual void leaveEvent(QEvent *) override; - virtual void mouseReleaseEvent(QMouseEvent *event) override; + void enterEvent(QEvent *event) override; + void leaveEvent(QEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; - virtual void dragEnterEvent(QDragEnterEvent *event) override; - virtual void dragMoveEvent(QDragMoveEvent *event) override; - virtual void dragLeaveEvent(QDragLeaveEvent *event) override; - virtual void dropEvent(QDropEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; + void dragMoveEvent(QDragMoveEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; private: struct DropRegion { @@ -89,7 +89,7 @@ private: std::pair getChatPosition(const Split *chatWidget); - Split *createChatWidget(const std::string &uuid); + Split *createChatWidget(); public: void refreshTitle(); diff --git a/src/widgets/streamview.cpp b/src/widgets/streamview.cpp index a3e2a0016..3961fdbba 100644 --- a/src/widgets/streamview.cpp +++ b/src/widgets/streamview.cpp @@ -12,7 +12,7 @@ namespace chatterino { namespace widgets { -StreamView::StreamView(ChannelPtr channel, QUrl url) +StreamView::StreamView(ChannelPtr channel, const QUrl &url) { util::LayoutCreator layoutCreator(this); @@ -22,8 +22,6 @@ StreamView::StreamView(ChannelPtr channel, QUrl url) web->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true); #endif - // QString uuid = CreateUUID(); - auto chat = layoutCreator.emplace(); chat->setFixedWidth(300); chat->setChannel(channel); diff --git a/src/widgets/streamview.hpp b/src/widgets/streamview.hpp index deb9f4d2f..6013fd7f4 100644 --- a/src/widgets/streamview.hpp +++ b/src/widgets/streamview.hpp @@ -16,7 +16,7 @@ namespace widgets { class StreamView : public QWidget { public: - StreamView(std::shared_ptr channel, QUrl url); + StreamView(std::shared_ptr channel, const QUrl &url); private: QWebEngineView *stream;