From 17aa3f71cd2b154c7016806dca4f03c606007c1c Mon Sep 17 00:00:00 2001 From: Leon Richardt Date: Thu, 19 Mar 2020 18:06:21 +0100 Subject: [PATCH] Remove Debug Output In Many Different Places (#1607) * Application.cpp: Remove whisper debug output * TwitchAccount.cpp: Remove AutoMod debug output * BaseWindow.cpp: Remove mouse tracking debug output * RunGui.cpp: Remove debug output for cleared cache items * Notebook.cpp: Remove debug output for selected widgets * LimitedQueue.hpp: Remove commented debug output * IrcMessageHandler.cpp: Remove debug output when receiving whispers * UserInfoPopup.cpp: Remove user name debug output * ChannelView.cpp: Remove debug output when clicking a message * Image.cpp: Remove commented debug output * AttachedWindow.cpp: Remove commented debug output * SplitOverlay.cpp: Remove commented debug output * TwitchMessageBuilder.cpp: Remove debug output for highlights * TwitchMessageBuilder.cpp: Remove debug output for blocked messages * PubsubClient.cpp: Remove debug output on PubSub::listen * PubsubClient.cpp: Remove debug output on PubSub::tryListen * IncognitoBrowser.cpp: Remove debug output of browser command * NativeMessaging.cpp: Remove debug output of message --- src/Application.cpp | 8 -------- src/RunGui.cpp | 5 ----- src/messages/Image.cpp | 4 ---- src/messages/LimitedQueue.hpp | 2 -- src/providers/twitch/IrcMessageHandler.cpp | 1 - src/providers/twitch/PubsubClient.cpp | 2 -- src/providers/twitch/TwitchAccount.cpp | 2 -- src/providers/twitch/TwitchMessageBuilder.cpp | 10 +--------- src/singletons/NativeMessaging.cpp | 2 -- src/util/IncognitoBrowser.cpp | 2 -- src/widgets/AttachedWindow.cpp | 2 -- src/widgets/BaseWindow.cpp | 2 -- src/widgets/Notebook.cpp | 1 - src/widgets/dialogs/UserInfoPopup.cpp | 2 -- src/widgets/helper/ChannelView.cpp | 1 - src/widgets/splits/SplitOverlay.cpp | 2 -- 16 files changed, 1 insertion(+), 47 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 8f9425011..a72d9bb38 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -145,14 +145,6 @@ void Application::initNm(Paths &paths) void Application::initPubsub() { - this->twitch.pubsub->signals_.whisper.sent.connect([](const auto &msg) { - qDebug() << "WHISPER SENT LOL"; // - }); - - this->twitch.pubsub->signals_.whisper.received.connect([](const auto &msg) { - qDebug() << "WHISPER RECEIVED LOL"; // - }); - this->twitch.pubsub->signals_.moderation.chatCleared.connect( [this](const auto &action) { auto chan = diff --git a/src/RunGui.cpp b/src/RunGui.cpp index 3088b6da1..e025d7f21 100644 --- a/src/RunGui.cpp +++ b/src/RunGui.cpp @@ -154,11 +154,6 @@ namespace { toBeRemoved << info.absoluteFilePath(); } } - - for (auto &&path : toBeRemoved) - { - qDebug() << path << QFile(path).remove(); - } } } // namespace diff --git a/src/messages/Image.cpp b/src/messages/Image.cpp index 39a30545f..4b115af37 100644 --- a/src/messages/Image.cpp +++ b/src/messages/Image.cpp @@ -226,10 +226,6 @@ ImagePtr Image::fromUrl(const Url &url, qreal scale) { cache[url] = shared = ImagePtr(new Image(url, scale)); } - else - { - // qDebug() << "same image created multiple times:" << url.string; - } return shared; } diff --git a/src/messages/LimitedQueue.hpp b/src/messages/LimitedQueue.hpp index 61e8db56f..22d1385eb 100644 --- a/src/messages/LimitedQueue.hpp +++ b/src/messages/LimitedQueue.hpp @@ -125,8 +125,6 @@ public: newChunks->at(0) = newFirstChunk; this->chunks_ = newChunks; - // qDebug() << acceptedItems.size(); - // qDebug() << this->chunks->at(0)->size(); if (this->chunks_->size() == 1) { diff --git a/src/providers/twitch/IrcMessageHandler.cpp b/src/providers/twitch/IrcMessageHandler.cpp index 60d5a5c5a..833586d44 100644 --- a/src/providers/twitch/IrcMessageHandler.cpp +++ b/src/providers/twitch/IrcMessageHandler.cpp @@ -451,7 +451,6 @@ void IrcMessageHandler::handleUserStateMessage(Communi::IrcMessage *message) void IrcMessageHandler::handleWhisperMessage(Communi::IrcMessage *message) { auto app = getApp(); - qDebug() << "Received whisper!"; MessageParseArgs args; args.isReceivedWhisper = true; diff --git a/src/providers/twitch/PubsubClient.cpp b/src/providers/twitch/PubsubClient.cpp index 43b24f2ef..c48d02c56 100644 --- a/src/providers/twitch/PubsubClient.cpp +++ b/src/providers/twitch/PubsubClient.cpp @@ -820,14 +820,12 @@ void PubSub::listen(rapidjson::Document &&msg) this->addClient(); - qDebug() << "Added to the back of the queue"; this->requests.emplace_back( std::make_unique(std::move(msg))); } bool PubSub::tryListen(rapidjson::Document &msg) { - qDebug() << "tryListen with" << this->clients.size() << "clients"; for (const auto &p : this->clients) { const auto &client = p.second; diff --git a/src/providers/twitch/TwitchAccount.cpp b/src/providers/twitch/TwitchAccount.cpp index 1b0f2c0ff..9ece767ae 100644 --- a/src/providers/twitch/TwitchAccount.cpp +++ b/src/providers/twitch/TwitchAccount.cpp @@ -386,7 +386,6 @@ void TwitchAccount::autoModAllow(const QString msgID) QString url("https://api.twitch.tv/kraken/chat/twitchbot/approve"); auto qba = (QString("{\"msg_id\":\"") + msgID + "\"}").toUtf8(); - qDebug() << qba; NetworkRequest(url, NetworkRequestType::Post) .header("Content-Type", "application/json") @@ -406,7 +405,6 @@ void TwitchAccount::autoModDeny(const QString msgID) QString url("https://api.twitch.tv/kraken/chat/twitchbot/deny"); auto qba = (QString("{\"msg_id\":\"") + msgID + "\"}").toUtf8(); - qDebug() << qba; NetworkRequest(url, NetworkRequestType::Post) .header("Content-Type", "application/json") diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index a5ecaae42..2eabd4054 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -174,8 +174,6 @@ bool TwitchMessageBuilder::isIgnored() const { if (phrase.isBlock() && phrase.isMatch(this->originalMessage_)) { - qDebug() << "Blocking message because it contains ignored phrase" - << phrase.getPattern(); return true; } } @@ -205,8 +203,7 @@ bool TwitchMessageBuilder::isIgnored() const case ShowIgnoredUsersMessages::Never: break; } - qDebug() << "Blocking message because it's from blocked user" - << user.name; + return true; } } @@ -1063,8 +1060,6 @@ void TwitchMessageBuilder::parseHighlights() { continue; } - qDebug() << "Highlight because user" << this->ircMessage->nick() - << "sent a message"; this->message().flags.set(MessageFlag::Highlighted); this->message().highlightColor = userHighlight.getColor(); @@ -1128,9 +1123,6 @@ void TwitchMessageBuilder::parseHighlights() continue; } - qDebug() << "Highlight because" << this->originalMessage_ << "matches" - << highlight.getPattern(); - this->message().flags.set(MessageFlag::Highlighted); this->message().highlightColor = highlight.getColor(); diff --git a/src/singletons/NativeMessaging.cpp b/src/singletons/NativeMessaging.cpp index 4d22f6fa4..51d1cedcc 100644 --- a/src/singletons/NativeMessaging.cpp +++ b/src/singletons/NativeMessaging.cpp @@ -187,8 +187,6 @@ void NativeMessagingServer::ReceiverThread::handleMessage( return; } - qDebug() << root; - if (action == "select") { QString _type = root.value("type").toString(); diff --git a/src/util/IncognitoBrowser.cpp b/src/util/IncognitoBrowser.cpp index 216c6f8c5..460f8fcfa 100644 --- a/src/util/IncognitoBrowser.cpp +++ b/src/util/IncognitoBrowser.cpp @@ -61,8 +61,6 @@ namespace { if (command.isNull()) return QString(); - qDebug() << command; - // inject switch to enable private browsing command = injectPrivateSwitch(command); if (command.isNull()) diff --git a/src/widgets/AttachedWindow.cpp b/src/widgets/AttachedWindow.cpp index 04c0dde01..83f7dbc06 100644 --- a/src/widgets/AttachedWindow.cpp +++ b/src/widgets/AttachedWindow.cpp @@ -29,8 +29,6 @@ BOOL CALLBACK enumWindows(HWND hwnd, LPARAM) auto className = std::make_unique(length); GetClassName(hwnd, className.get(), length); - // qDebug() << QString::fromWCharArray(className.get(), length); - if (lstrcmp(className.get(), L"Shell_TrayWnd") == 0 || lstrcmp(className.get(), L"Shell_Secondary") == 0) { diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index b1e939db1..c3bc34c95 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -384,7 +384,6 @@ void BaseWindow::mousePressEvent(QMouseEvent *event) if (!recursiveCheckMouseTracking(widget)) { - qDebug() << "Start moving"; this->moving = true; } } @@ -401,7 +400,6 @@ void BaseWindow::mouseReleaseEvent(QMouseEvent *event) { if (this->moving) { - qDebug() << "Stop moving"; this->moving = false; } } diff --git a/src/widgets/Notebook.cpp b/src/widgets/Notebook.cpp index b0fa87e68..f840cea39 100644 --- a/src/widgets/Notebook.cpp +++ b/src/widgets/Notebook.cpp @@ -149,7 +149,6 @@ void Notebook::select(QWidget *page) { if (containsChild(page, item.selectedWidget)) { - qDebug() << item.selectedWidget; item.selectedWidget->setFocus(Qt::MouseFocusReason); } else diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index a4d0f2220..7e2d3c7c2 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -158,8 +158,6 @@ UserInfoPopup::UserInfoPopup() if (twitchChannel) { - qDebug() << this->userName_; - bool isMyself = QString::compare( getApp()->accounts->twitch.getCurrent()->getUserName(), diff --git a/src/widgets/helper/ChannelView.cpp b/src/widgets/helper/ChannelView.cpp index c2542354d..0ef31599b 100644 --- a/src/widgets/helper/ChannelView.cpp +++ b/src/widgets/helper/ChannelView.cpp @@ -1701,7 +1701,6 @@ void ChannelView::handleLinkClick(QMouseEvent *event, const Link &link, case Link::UserInfo: { auto user = link.value; this->showUserInfoPopup(user); - qDebug() << "Clicked " << user << "s message"; } break; diff --git a/src/widgets/splits/SplitOverlay.cpp b/src/widgets/splits/SplitOverlay.cpp index b4c293034..981601c70 100644 --- a/src/widgets/splits/SplitOverlay.cpp +++ b/src/widgets/splits/SplitOverlay.cpp @@ -158,8 +158,6 @@ void SplitOverlay::mouseMoveEvent(QMouseEvent *event) { BaseWidget::mouseMoveEvent(event); - // qDebug() << QGuiApplication::queryKeyboardModifiers(); - // if ((QGuiApplication::queryKeyboardModifiers() & Qt::AltModifier) == // Qt::AltModifier) { // this->hide();