diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-03-01 15:13:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-03-01 15:13:10 +0300 |
commit | 0192d44d46dcf948ab26371862753f4baf5aae4e (patch) | |
tree | c8fc3ff1d7375638b891ebda06643fa194fe294f /src/gui/widgets/browserbox.cpp | |
parent | 2c02974d98d94f54b70434202bb2edf4cba8640f (diff) | |
download | mv-0192d44d46dcf948ab26371862753f4baf5aae4e.tar.gz mv-0192d44d46dcf948ab26371862753f4baf5aae4e.tar.bz2 mv-0192d44d46dcf948ab26371862753f4baf5aae4e.tar.xz mv-0192d44d46dcf948ab26371862753f4baf5aae4e.zip |
Show item links with empty item name.
Diffstat (limited to 'src/gui/widgets/browserbox.cpp')
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index fe99d5f89..647013889 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -36,8 +36,11 @@ #include "resources/image.h" #include "resources/imageset.h" +#include "resources/iteminfo.h" #include "resources/resourcemanager.h" +#include "resources/db/itemdb.h" + #include "utils/stringutils.h" #include "utils/timer.h" @@ -243,6 +246,14 @@ void BrowserBox::addRow(const std::string &row, const bool atTop) bLink.caption = tmp.substr(idx2 + 1, idx3 - (idx2 + 1)); bLink.y1 = sz * font->getHeight(); bLink.y2 = bLink.y1 + font->getHeight(); + if (bLink.caption.empty()) + { + const int id = atoi(bLink.link.c_str()); + if (id) + bLink.caption = ItemDB::get(id).getName(); + else + bLink.caption = bLink.link; + } newRow.append(tmp.substr(0, idx1)); |