[network/ruqola] src/widgets: Add new debug category
Laurent Montel <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit b3db221a52ef3ec0baa4fa0abfc5f3cad0caad69 by Laurent Montel.
Committed on 29/07/2026 at 21:25.
Pushed by mlaurent into branch 'master'.
Add new debug category
M +4 -0 src/widgets/CMakeLists.txt
M +4 -0 src/widgets/room/messagelistview.cpp
M +2 -0 src/widgets/room/newmessageindicator.cpp
https://invent.kde.org/network/ruqola/-/commit/b3db221a52ef3ec0baa4fa0abfc5f3cad0caad69
diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index c4e2a9e8c8..cbf7375b4f 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -1194,6 +1194,10 @@ ecm_qt_declare_logging_category(libruqolawidgets_debug_SRCS HEADER ruqola_delega
CATEGORY_NAME org.kde.ruqola.delegate.lastunseedline.widgets DESCRIPTION "ruqola delegate last unseen line" EXPORT RUQOLA
)
+ecm_qt_declare_logging_category(libruqolawidgets_debug_SRCS HEADER ruqola_newmessageindicator_debug.h IDENTIFIER RUQOLA_NEWMESSAGEINDICATOR_WIDGETS_LOG
+ CATEGORY_NAME org.kde.ruqola.newmessageindicator.widgets DESCRIPTION "ruqola new message indicator" EXPORT RUQOLA
+)
+
target_sources(libruqolawidgets PRIVATE ${libruqolawidgets_debug_SRCS})
if(COMPILE_WITH_UNITY_CMAKE_SUPPORT)
diff --git a/src/widgets/room/messagelistview.cpp b/src/widgets/room/messagelistview.cpp
index a98a57a462..47fea831b8 100644
--- a/src/widgets/room/messagelistview.cpp
+++ b/src/widgets/room/messagelistview.cpp
@@ -57,6 +57,7 @@
#include <QScrollBar>
#include "newmessageindicator.h"
+#include "ruqola_newmessageindicator_debug.h"
#include "ruqolaglobalconfig.h"
#include "config-ruqola.h"
@@ -205,6 +206,8 @@ void MessageListView::updateNewMessageIndicatorVisibility()
const auto *vbar = verticalScrollBar();
const bool notAtBottom = vbar->value() < vbar->maximum();
const bool hasUnread = mRoom && (mRoom->unread() > 0);
+ qCDebug(RUQOLA_NEWMESSAGEINDICATOR_WIDGETS_LOG) << "MessageListView::updateNewMessageIndicatorVisibility" << " hasUnread " << hasUnread << " notAtBottom"
+ << notAtBottom;
const bool shouldShow = notAtBottom && hasUnread;
if (shouldShow && !mNewMessageIndicator->isVisible()) {
repositionNewMessageIndicator();
@@ -217,6 +220,7 @@ void MessageListView::updateNewMessageIndicatorVisibility()
void MessageListView::repositionNewMessageIndicator()
{
+ qCDebug(RUQOLA_NEWMESSAGEINDICATOR_WIDGETS_LOG) << "MessageListView::repositionNewMessageIndicator";
if (!mNewMessageIndicator) {
return;
}
diff --git a/src/widgets/room/newmessageindicator.cpp b/src/widgets/room/newmessageindicator.cpp
index 08ac0fe2b7..b0663e5cff 100644
--- a/src/widgets/room/newmessageindicator.cpp
+++ b/src/widgets/room/newmessageindicator.cpp
@@ -4,6 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "newmessageindicator.h"
+#include "ruqola_newmessageindicator_debug.h"
#include <KLocalizedString>
#include <QVBoxLayout>
using namespace Qt::Literals::StringLiterals;
@@ -35,6 +36,7 @@ NewMessageIndicator::~NewMessageIndicator() = default;
void NewMessageIndicator::showNewMessageIndicator(bool visible)
{
+ qCDebug(RUQOLA_NEWMESSAGEINDICATOR_WIDGETS_LOG) << "NewMessageIndicator::showNewMessageIndicator: " << visible;
setVisible(visible);
}