Changeset View
Changeset View
Standalone View
Standalone View
src/mode/katemodemanager.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
49 | 49 | | |||
50 | KateModeManager::~KateModeManager() | 50 | KateModeManager::~KateModeManager() | ||
51 | { | 51 | { | ||
52 | qDeleteAll(m_types); | 52 | qDeleteAll(m_types); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | bool compareKateFileType(const KateFileType *const left, const KateFileType *const right) | 55 | bool compareKateFileType(const KateFileType *const left, const KateFileType *const right) | ||
56 | { | 56 | { | ||
57 | int comparison = left->section.compare(right->section, Qt::CaseInsensitive); | 57 | int comparison = left->translatedSection.compare(right->translatedSection, Qt::CaseInsensitive); | ||
58 | if (comparison == 0) { | 58 | if (comparison == 0) { | ||
59 | comparison = left->name.compare(right->name, Qt::CaseInsensitive); | 59 | comparison = left->translatedName.compare(right->translatedName, Qt::CaseInsensitive); | ||
60 | } | 60 | } | ||
61 | return comparison < 0; | 61 | return comparison < 0; | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | // | 64 | // | ||
65 | // read the types from config file and update the internal list | 65 | // read the types from config file and update the internal list | ||
66 | // | 66 | // | ||
67 | void KateModeManager::update() | 67 | void KateModeManager::update() | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 68 | { | |||
136 | } | 136 | } | ||
137 | 137 | | |||
138 | // sort the list... | 138 | // sort the list... | ||
139 | std::sort(m_types.begin(), m_types.end(), compareKateFileType); | 139 | std::sort(m_types.begin(), m_types.end(), compareKateFileType); | ||
140 | 140 | | |||
141 | // add the none type... | 141 | // add the none type... | ||
142 | KateFileType *t = new KateFileType(); | 142 | KateFileType *t = new KateFileType(); | ||
143 | 143 | | |||
144 | // DO NOT TRANSLATE THIS, DONE LATER, marked by hlGenerated | 144 | // marked by hlGenerated | ||
145 | t->name = QStringLiteral("Normal"); | 145 | t->name = QStringLiteral("Normal"); | ||
146 | t->translatedName = i18n("Normal"); | ||||
146 | t->hl = QStringLiteral("None"); | 147 | t->hl = QStringLiteral("None"); | ||
147 | t->hlGenerated = true; | 148 | t->hlGenerated = true; | ||
148 | 149 | | |||
149 | m_types.prepend(t); | 150 | m_types.prepend(t); | ||
150 | } | 151 | } | ||
151 | 152 | | |||
152 | // | 153 | // | ||
153 | // save the given list to config file + update | 154 | // save the given list to config file + update | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |