From d3c4d4b8cf5303bca05797839d566c8a6e15981c Mon Sep 17 00:00:00 2001 From: TranRed Date: Sun, 8 Sep 2019 12:05:41 +0200 Subject: [PATCH] moved anonymous namespace into chatterino namespace --- src/widgets/dialogs/UserInfoPopup.cpp | 64 +++++++++++++-------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index b774b0545..a75345dc7 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -28,48 +28,46 @@ #define TEXT_VIEWS "Views: " #define TEXT_CREATED "Created: " +namespace chatterino { + namespace { -const auto borderColor = QColor(255, 255, 255, 80); + const auto borderColor = QColor(255, 255, 255, 80); -int calculateTimeoutDuration(TimeoutButton timeout) -{ - static const QMap durations{ - {"s", 1}, {"m", 60}, {"h", 3600}, {"d", 86400}, {"w", 604800}, - }; - return timeout.second * durations[timeout.first]; -} - -chatterino::ChannelPtr filterMessages(const QString &userName, - chatterino::ChannelPtr channel) -{ - chatterino::LimitedQueueSnapshot snapshot = - channel->getMessageSnapshot(); - - chatterino::ChannelPtr channelPtr(new chatterino::Channel( - channel->getName(), chatterino::Channel::Type::None)); - - for (size_t i = 0; i < snapshot.size(); i++) + int calculateTimeoutDuration(TimeoutButton timeout) { - chatterino::MessagePtr message = snapshot[i]; - - bool isSelectedUser = - message->loginName.compare(userName, Qt::CaseInsensitive) == 0; - - if (isSelectedUser && - !message->flags.has(chatterino::MessageFlag::Whisper)) - { - channelPtr->addMessage(message); - } + static const QMap durations{ + {"s", 1}, {"m", 60}, {"h", 3600}, {"d", 86400}, {"w", 604800}, + }; + return timeout.second * durations[timeout.first]; } - return channelPtr; -} + ChannelPtr filterMessages(const QString &userName, ChannelPtr channel) + { + LimitedQueueSnapshot snapshot = + channel->getMessageSnapshot(); + + ChannelPtr channelPtr( + new Channel(channel->getName(), Channel::Type::None)); + + for (size_t i = 0; i < snapshot.size(); i++) + { + MessagePtr message = snapshot[i]; + + bool isSelectedUser = + message->loginName.compare(userName, Qt::CaseInsensitive) == 0; + + if (isSelectedUser && !message->flags.has(MessageFlag::Whisper)) + { + channelPtr->addMessage(message); + } + } + + return channelPtr; + } } // namespace -namespace chatterino { - UserInfoPopup::UserInfoPopup() : BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless | BaseWindow::FramelessDraggable))