Remove some UUID remnants
This commit is contained in:
Rasmus Karlsson 2018-04-07 12:53:10 +02:00
parent 945d500701
commit c82254aa9e
6 changed files with 22 additions and 27 deletions

View file

@ -103,7 +103,7 @@ void Notebook::removePage(SplitContainer *page)
this->pages.removeOne(page); this->pages.removeOne(page);
if (this->pages.size() == 0) { if (this->pages.empty()) {
this->addNewPage(); this->addNewPage();
} }

View file

@ -74,11 +74,11 @@ public:
void drag(); void drag();
protected: protected:
void paintEvent(QPaintEvent *) override; void paintEvent(QPaintEvent *event) override;
void mouseMoveEvent(QMouseEvent *) override; void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override; void mousePressEvent(QMouseEvent *event) override;
void keyPressEvent(QKeyEvent *) override; void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *) override; void keyReleaseEvent(QKeyEvent *event) override;
private: private:
SplitContainer &parentPage; SplitContainer &parentPage;

View file

@ -212,12 +212,9 @@ NotebookTab *SplitContainer::getTab() const
return this->tab; return this->tab;
} }
void SplitContainer::addChat(bool openChannelNameDialog, std::string chatUUID) void SplitContainer::addChat(bool openChannelNameDialog)
{ {
if (chatUUID.empty()) { Split *w = this->createChatWidget();
chatUUID = CreateUUID().toStdString();
}
Split *w = this->createChatWidget(chatUUID);
if (openChannelNameDialog) { if (openChannelNameDialog) {
bool ret = w->showChangeChannelPopup("Open channel name", true); bool ret = w->showChangeChannelPopup("Open channel name", true);
@ -505,7 +502,7 @@ std::pair<int, int> SplitContainer::getChatPosition(const Split *chatWidget)
return getWidgetPositionInLayout(layout, chatWidget); return getWidgetPositionInLayout(layout, chatWidget);
} }
Split *SplitContainer::createChatWidget(const std::string &uuid) Split *SplitContainer::createChatWidget()
{ {
auto split = new Split(this); auto split = new Split(this);

View file

@ -29,7 +29,7 @@ public:
std::vector<std::vector<Split *>> getColumns() const; std::vector<std::vector<Split *>> getColumns() const;
NotebookTab *getTab() const; NotebookTab *getTab() const;
void addChat(bool openChannelNameDialog = false, std::string chatUUID = std::string()); void addChat(bool openChannelNameDialog = false);
static bool isDraggingSplit; static bool isDraggingSplit;
static Split *draggingSplit; static Split *draggingSplit;
@ -46,19 +46,19 @@ public:
int splitCount() const; int splitCount() const;
protected: protected:
virtual bool eventFilter(QObject *object, QEvent *event) override; bool eventFilter(QObject *object, QEvent *event) override;
virtual void paintEvent(QPaintEvent *) override; void paintEvent(QPaintEvent *event) override;
virtual void showEvent(QShowEvent *) override; void showEvent(QShowEvent *event) override;
virtual void enterEvent(QEvent *) override; void enterEvent(QEvent *event) override;
virtual void leaveEvent(QEvent *) override; void leaveEvent(QEvent *event) override;
virtual void mouseReleaseEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override;
virtual void dragEnterEvent(QDragEnterEvent *event) override; void dragEnterEvent(QDragEnterEvent *event) override;
virtual void dragMoveEvent(QDragMoveEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override;
virtual void dragLeaveEvent(QDragLeaveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override;
virtual void dropEvent(QDropEvent *event) override; void dropEvent(QDropEvent *event) override;
private: private:
struct DropRegion { struct DropRegion {
@ -89,7 +89,7 @@ private:
std::pair<int, int> getChatPosition(const Split *chatWidget); std::pair<int, int> getChatPosition(const Split *chatWidget);
Split *createChatWidget(const std::string &uuid); Split *createChatWidget();
public: public:
void refreshTitle(); void refreshTitle();

View file

@ -12,7 +12,7 @@
namespace chatterino { namespace chatterino {
namespace widgets { namespace widgets {
StreamView::StreamView(ChannelPtr channel, QUrl url) StreamView::StreamView(ChannelPtr channel, const QUrl &url)
{ {
util::LayoutCreator<StreamView> layoutCreator(this); util::LayoutCreator<StreamView> layoutCreator(this);
@ -22,8 +22,6 @@ StreamView::StreamView(ChannelPtr channel, QUrl url)
web->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true); web->settings()->setAttribute(QWebEngineSettings::FullScreenSupportEnabled, true);
#endif #endif
// QString uuid = CreateUUID();
auto chat = layoutCreator.emplace<ChannelView>(); auto chat = layoutCreator.emplace<ChannelView>();
chat->setFixedWidth(300); chat->setFixedWidth(300);
chat->setChannel(channel); chat->setChannel(channel);

View file

@ -16,7 +16,7 @@ namespace widgets {
class StreamView : public QWidget class StreamView : public QWidget
{ {
public: public:
StreamView(std::shared_ptr<Channel> channel, QUrl url); StreamView(std::shared_ptr<Channel> channel, const QUrl &url);
private: private:
QWebEngineView *stream; QWebEngineView *stream;