From 581f56463f6ecf7d72d56106e3893aa549790144 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 1 Mar 2015 15:13:10 +0300 Subject: Show item links with empty item name. (cherry picked from commit 0192d44d46dcf948ab26371862753f4baf5aae4e) --- src/gui/widgets/browserbox.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index f21a4e16..64b494db 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -28,6 +28,8 @@ #include "gui/truetypefont.h" #include "gui/widgets/linkhandler.h" +#include "resources/itemdb.h" +#include "resources/iteminfo.h" #include "resources/theme.h" #include @@ -96,6 +98,15 @@ void BrowserBox::addRow(const std::string &row) link.link = tmp.substr(idx1 + 2, idx2 - (idx1 + 2)); link.caption = tmp.substr(idx2 + 1, idx3 - (idx2 + 1)); + if (link.caption.empty()) + { + const int id = atoi(link.link.c_str()); + if (id) + link.caption = itemDb->get(id).getName(); + else + link.caption = link.link; + } + newRow.text += tmp.substr(0, idx1); newRow.text += "##<" + link.caption; -- cgit v1.2.3-70-g09d2