Changeset View
Changeset View
Standalone View
Standalone View
src/mode/katemodemenu.cpp
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | 54 | { | |||
---|---|---|---|---|---|
55 | KTextEditor::DocumentPrivate *doc = m_doc; | 55 | KTextEditor::DocumentPrivate *doc = m_doc; | ||
56 | int count = KTextEditor::EditorPrivate::self()->modeManager()->list().count(); | 56 | int count = KTextEditor::EditorPrivate::self()->modeManager()->list().count(); | ||
57 | 57 | | |||
58 | for (int z = 0; z < count; z++) { | 58 | for (int z = 0; z < count; z++) { | ||
59 | QString nameRaw = KTextEditor::EditorPrivate::self()->modeManager()->list().at(z)->name; | 59 | QString nameRaw = KTextEditor::EditorPrivate::self()->modeManager()->list().at(z)->name; | ||
60 | QString hlName = KTextEditor::EditorPrivate::self()->modeManager()->list().at(z)->nameTranslated(); | 60 | QString hlName = KTextEditor::EditorPrivate::self()->modeManager()->list().at(z)->nameTranslated(); | ||
61 | QString hlSection = KTextEditor::EditorPrivate::self()->modeManager()->list().at(z)->sectionTranslated(); | 61 | QString hlSection = KTextEditor::EditorPrivate::self()->modeManager()->list().at(z)->sectionTranslated(); | ||
62 | 62 | | |||
63 | if (hlName.isEmpty()) { | ||||
64 | continue; | ||||
65 | } | ||||
63 | if (!hlSection.isEmpty() && !names.contains(hlName)) { | 66 | if (!hlSection.isEmpty() && !names.contains(hlName)) { | ||
64 | if (!subMenusName.contains(hlSection)) { | 67 | if (!subMenusName.contains(hlSection)) { | ||
65 | subMenusName << hlSection; | 68 | subMenusName << hlSection; | ||
66 | QMenu *qmenu = new QMenu(hlSection); | 69 | QMenu *qmenu = new QMenu(hlSection); | ||
67 | connect(qmenu, SIGNAL(triggered(QAction *)), this, SLOT(setType(QAction *))); | 70 | connect(qmenu, SIGNAL(triggered(QAction *)), this, SLOT(setType(QAction *))); | ||
68 | subMenus.append(qmenu); | 71 | subMenus.append(qmenu); | ||
69 | menu()->addMenu(qmenu); | 72 | menu()->addMenu(qmenu); | ||
70 | } | 73 | } | ||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |