From 90551acf3717bbd6982c5bf1d172356d0785882f Mon Sep 17 00:00:00 2001 From: fourtf Date: Fri, 25 May 2018 18:23:13 +0200 Subject: [PATCH] changed "justinfanXXX" to "anonymous" --- src/widgets/window.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/widgets/window.cpp b/src/widgets/window.cpp index 331e143f4..d90d31182 100644 --- a/src/widgets/window.cpp +++ b/src/widgets/window.cpp @@ -31,11 +31,17 @@ Window::Window(WindowType _type) { auto app = getApp(); - app->accounts->Twitch.currentUsername.connect([this](const std::string &newUsername, auto) { - if (newUsername.empty()) { + app->accounts->Twitch.currentUserChanged.connect([this] { + auto user = getApp()->accounts->Twitch.getCurrent(); + + if (user->isAnon()) { this->refreshWindowTitle("Not logged in"); + + this->userLabel->getLabel().setText("anonymous"); } else { - this->refreshWindowTitle(QString::fromStdString(newUsername)); + this->refreshWindowTitle(user->getUserName()); + + this->userLabel->getLabel().setText(user->getUserName()); } }); @@ -48,10 +54,6 @@ Window::Window(WindowType _type) app->windows->showAccountSelectPopup( this->userLabel->mapToGlobal(this->userLabel->rect().bottomLeft())); // }); - - app->accounts->Twitch.currentUserChanged.connect([=] { - this->userLabel->getLabel().setText(app->accounts->Twitch.getCurrent()->getUserName()); - }); } if (_type == Window::Main) {