Allow to hide categories in CategorizedCombo

font combos do not need that
This commit is contained in:
Juergen Spitzmueller 2023-01-30 08:45:58 +01:00
parent 6656dd2275
commit b260ff8b27
2 changed files with 3 additions and 3 deletions

View File

@ -476,13 +476,13 @@ bool CategorizedCombo::set(QString const & item)
void CategorizedCombo::addItemSort(QString const & item, QString const & guiname,
QString const & category, QString const & tooltip,
bool sorted, bool sortedByCat, bool sortCats,
bool available)
bool available, bool nocategories)
{
QString titem = available ? guiname
: toqstr(bformat(_("Unavailable: %1$s"),
qstring_to_ucs4(guiname)));
bool const uncategorized = category.isEmpty();
QString qcat = uncategorized ? qt_("Uncategorized") : category;
QString qcat = (uncategorized && !nocategories) ? qt_("Uncategorized") : category;
QList<QStandardItem *> row;
QStandardItem * gui = new QStandardItem(titem);

View File

@ -49,7 +49,7 @@ public:
void addItemSort(QString const & item, QString const & guiname,
QString const & category, QString const & tooltip,
bool sorted, bool sortedByCat, bool sortCats,
bool available);
bool available, bool nocategories = false);
///
QString getData(int row) const;
///