Changeset View
Changeset View
Standalone View
Standalone View
src/syntax/katehighlightmenu.cpp
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
51 | void KateHighlightingMenu::slotAboutToShow() | 51 | void KateHighlightingMenu::slotAboutToShow() | ||
52 | { | 52 | { | ||
53 | for (const auto &hl : KateHlManager::self()->modeList()) { | 53 | for (const auto &hl : KateHlManager::self()->modeList()) { | ||
54 | QString hlName = hl.translatedName(); | 54 | QString hlName = hl.translatedName(); | ||
55 | QString hlSection = hl.translatedSection(); | 55 | QString hlSection = hl.translatedSection(); | ||
56 | if (hlName == QLatin1String("None")) | 56 | if (hlName == QLatin1String("None")) | ||
57 | hlName = i18n("None"); | 57 | hlName = i18n("None"); | ||
58 | 58 | | |||
59 | if (!hl.isHidden()) { | 59 | if (!hl.isHidden() && !hlName.isEmpty()) { | ||
60 | if (!hlSection.isEmpty() && !names.contains(hlName)) { | 60 | if (!hlSection.isEmpty() && !names.contains(hlName)) { | ||
61 | if (!subMenusName.contains(hlSection)) { | 61 | if (!subMenusName.contains(hlSection)) { | ||
62 | subMenusName << hlSection; | 62 | subMenusName << hlSection; | ||
63 | QMenu *qmenu = new QMenu(QLatin1Char('&') + hlSection); | 63 | QMenu *qmenu = new QMenu(QLatin1Char('&') + hlSection); | ||
64 | subMenus.append(qmenu); | 64 | subMenus.append(qmenu); | ||
65 | menu()->addMenu(qmenu); | 65 | menu()->addMenu(qmenu); | ||
66 | } | 66 | } | ||
67 | 67 | | |||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |