Changeset View
Changeset View
Standalone View
Standalone View
src/mode/katemodemenu.cpp
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 107 | if (doc->fileType().isEmpty() || doc->fileType() == QLatin1String("Normal")) { | |||
---|---|---|---|---|---|
108 | for (int i = 0; i < actions.count(); ++i) { | 108 | for (int i = 0; i < actions.count(); ++i) { | ||
109 | if (actions[ i ]->data().toString() == QLatin1String("Normal")) { | 109 | if (actions[ i ]->data().toString() == QLatin1String("Normal")) { | ||
110 | actions[ i ]->setChecked(true); | 110 | actions[ i ]->setChecked(true); | ||
111 | } | 111 | } | ||
112 | } | 112 | } | ||
113 | } else { | 113 | } else { | ||
114 | if (!doc->fileType().isEmpty()) { | 114 | if (!doc->fileType().isEmpty()) { | ||
115 | const KateFileType &t = KTextEditor::EditorPrivate::self()->modeManager()->fileType(doc->fileType()); | 115 | const KateFileType &t = KTextEditor::EditorPrivate::self()->modeManager()->fileType(doc->fileType()); | ||
116 | int i = subMenusName.indexOf(t.section); | 116 | int i = subMenusName.indexOf(t.sectionTranslated()); | ||
117 | if (i >= 0 && subMenus.at(i)) { | 117 | if (i >= 0 && subMenus.at(i)) { | ||
118 | QList<QAction *> actions = subMenus.at(i)->actions(); | 118 | QList<QAction *> actions = subMenus.at(i)->actions(); | ||
119 | for (int j = 0; j < actions.count(); ++j) { | 119 | for (int j = 0; j < actions.count(); ++j) { | ||
120 | if (actions[ j ]->data().toString() == doc->fileType()) { | 120 | if (actions[ j ]->data().toString() == doc->fileType()) { | ||
121 | actions[ j ]->setChecked(true); | 121 | actions[ j ]->setChecked(true); | ||
122 | } | 122 | } | ||
123 | } | 123 | } | ||
124 | } else { | 124 | } else { | ||
Show All 20 Lines |