From a736075d5ba2da3a43b81656a531f745a1755e3f Mon Sep 17 00:00:00 2001 From: ronso0 Date: Thu, 26 Aug 2021 21:53:05 +0200 Subject: [PATCH] Sidebar: use item label for tooltip, show id when debugging --- src/library/sidebarmodel.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/library/sidebarmodel.cpp b/src/library/sidebarmodel.cpp index 73e8c48764bd..55d0c35590ce 100644 --- a/src/library/sidebarmodel.cpp +++ b/src/library/sidebarmodel.cpp @@ -9,6 +9,7 @@ #include "library/treeitem.h" #include "moc_sidebarmodel.cpp" #include "util/assert.h" +#include "util/cmdlineargs.h" namespace { @@ -254,11 +255,11 @@ QVariant SidebarModel::data(const QModelIndex& index, int role) const { case Qt::DisplayRole: return pTreeItem->getLabel(); case Qt::ToolTipRole: { - // If it's the "Quick Links" node, display it's name - if (pTreeItem->getData().toString() == QUICK_LINK_NODE) { - return pTreeItem->getLabel(); + if (CmdlineArgs::Instance().getDeveloper()) { + // Display the internal data for debugging + return pTreeItem->getData(); } - return pTreeItem->getData(); + return pTreeItem->getLabel(); } case Qt::FontRole: { QFont font;