diff options
| author | Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> | 2026-02-18 19:48:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-18 19:48:12 +0100 |
| commit | 2043d9931cb9baf1eef23240ea6061fc40fee67d (patch) | |
| tree | c337eed239a5da6e14f387fc32f94933f2456680 | |
| parent | 4da0bffeee05c4589ae4d0addc7c695e31669990 (diff) | |
Remove "Categories: " tooltips when there are no categories (#2339)
| -rw-r--r-- | src/modinforegular.cpp | 4 | ||||
| -rw-r--r-- | src/modlist.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/modinforegular.cpp b/src/modinforegular.cpp index c529c054..0e73b70c 100644 --- a/src/modinforegular.cpp +++ b/src/modinforegular.cpp @@ -744,6 +744,10 @@ QString ModInfoRegular::getDescription() const .arg(name()); } else { const std::set<int>& categories = getCategories(); + if (categories.empty()) { + return QString(); + } + std::wostringstream categoryString; categoryString << ToWString(tr("Categories: <br>")); CategoryFactory& categoryFactory = CategoryFactory::instance(); diff --git a/src/modlist.cpp b/src/modlist.cpp index 4ff3654c..143526d6 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -449,6 +449,10 @@ QVariant ModList::data(const QModelIndex& modelIndex, int role) const return text; } else if (column == COL_CATEGORY) { const std::set<int>& categories = modInfo->getCategories(); + if (categories.empty()) { + return QString(); + } + std::wostringstream categoryString; categoryString << ToWString(tr("Categories: <br>")); CategoryFactory& categoryFactory = CategoryFactory::instance(); |
