diff options
author | Fedja Beader <fedja@protonmail.ch> | 2025-07-10 21:49:16 +0000 |
---|---|---|
committer | Fedja Beader <fedja@protonmail.ch> | 2025-07-10 21:49:16 +0000 |
commit | dc5851bb5018300cf0b3f7e3887124fc5f0fe5e9 (patch) | |
tree | 5f4ffe6c609d5e1acbc557360a613b1db326c1b7 | |
parent | 0ee0dce2d35a9d606f91ff5e217cbe5feca63cdb (diff) | |
download | mv-dc5851bb5018300cf0b3f7e3887124fc5f0fe5e9.tar.gz mv-dc5851bb5018300cf0b3f7e3887124fc5f0fe5e9.tar.bz2 mv-dc5851bb5018300cf0b3f7e3887124fc5f0fe5e9.tar.xz mv-dc5851bb5018300cf0b3f7e3887124fc5f0fe5e9.zip |
Move browserbox include from ChatTab header to implementation
downside: these two proxy funcs can no longer be inlined. But, they're
only used by previous/next chat keybinds. Thus, the performance impact should be minimal (if they were even inlined in the first place).
**** mana/verse!216
-rw-r--r-- | src/gui/widgets/tabs/chat/chattab.cpp | 11 | ||||
-rw-r--r-- | src/gui/widgets/tabs/chat/chattab.h | 22 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 1 |
3 files changed, 26 insertions, 8 deletions
diff --git a/src/gui/widgets/tabs/chat/chattab.cpp b/src/gui/widgets/tabs/chat/chattab.cpp index ef23dc0bc..b09e57585 100644 --- a/src/gui/widgets/tabs/chat/chattab.cpp +++ b/src/gui/widgets/tabs/chat/chattab.cpp @@ -38,6 +38,7 @@ #include "gui/windows/chatwindow.h" #include "gui/windows/helpwindow.h" +#include "gui/widgets/browserbox.h" #include "gui/widgets/scrollarea.h" #include "gui/widgets/itemlinkhandler.h" #include "gui/widgets/tabbedarea.h" @@ -437,6 +438,16 @@ void ChatTab::clearText() mTextOutput->clearRows(); } +const std::list<std::string> &ChatTab::getRows() const +{ + return mTextOutput->getRows(); +} + +bool ChatTab::hasRows() const +{ + return mTextOutput->hasRows(); +} + void ChatTab::handleInput(const std::string &msg) { if (chatHandler) diff --git a/src/gui/widgets/tabs/chat/chattab.h b/src/gui/widgets/tabs/chat/chattab.h index a08429b24..3cab5f54d 100644 --- a/src/gui/widgets/tabs/chat/chattab.h +++ b/src/gui/widgets/tabs/chat/chattab.h @@ -31,12 +31,11 @@ #include "enums/simpletypes/online.h" #include "enums/simpletypes/tryremovecolors.h" -#include "gui/widgets/browserbox.h" - #include "gui/widgets/tabs/tab.h" #include "localconsts.h" +class BrowserBox; class ScrollArea; #define debugMsg(str) \ @@ -115,10 +114,23 @@ class ChatTab notfinal : public Tab /** * Clears the text from the tab + * @see BrowserBox::clearRows */ void clearText(); /** + * Returns lines of text from the widget, + * @see BrowserBox::getRows + */ + const std::list<std::string> &getRows() const A_WARN_UNUSED; + + /** + * true if the widget has any lines + * @see BrowserBox::hasRows + */ + bool hasRows() const A_WARN_UNUSED; + + /** * Handle special commands. Allows a tab to handle commands it * defines itself. * @@ -147,12 +159,6 @@ class ChatTab notfinal : public Tab void saveToLogFile(const std::string &msg) const; - const std::list<std::string> &getRows() const A_WARN_UNUSED - { return mTextOutput->getRows(); } - - bool hasRows() const A_WARN_UNUSED - { return mTextOutput->hasRows(); } - void loadFromLogFile(const std::string &name, const unsigned maxLines); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d584de593..71e94adc6 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -52,6 +52,7 @@ #include "gui/windows/setupwindow.h" #include "gui/windows/whoisonline.h" +#include "gui/widgets/browserbox.h" #include "gui/widgets/button.h" #include "gui/widgets/chatinput.h" #include "gui/widgets/createwidget.h" |