Changeset View
Changeset View
Standalone View
Standalone View
src/cataloglistview/catalogmodel.cpp
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 119 | switch (static_cast<CatalogModelColumns>(section)) { | |||
---|---|---|---|---|---|
126 | case CatalogModelColumns::Notes: | 126 | case CatalogModelColumns::Notes: | ||
127 | return i18nc("@title:column", "Notes"); | 127 | return i18nc("@title:column", "Notes"); | ||
128 | case CatalogModelColumns::Context: | 128 | case CatalogModelColumns::Context: | ||
129 | return i18nc("@title:column", "Context"); | 129 | return i18nc("@title:column", "Context"); | ||
130 | case CatalogModelColumns::Files: | 130 | case CatalogModelColumns::Files: | ||
131 | return i18nc("@title:column", "Files"); | 131 | return i18nc("@title:column", "Files"); | ||
132 | case CatalogModelColumns::TranslationStatus: | 132 | case CatalogModelColumns::TranslationStatus: | ||
133 | return i18nc("@title:column", "Translation Status"); | 133 | return i18nc("@title:column", "Translation Status"); | ||
134 | case CatalogModelColumns::SourceLength: | ||||
135 | return i18nc("@title:column Length of the original text", "Source length"); | ||||
136 | case CatalogModelColumns::TargetLength: | ||||
137 | return i18nc("@title:column Length of the text in target language", "Target length"); | ||||
134 | default: | 138 | default: | ||
135 | return {}; | 139 | return {}; | ||
136 | } | 140 | } | ||
137 | } | 141 | } | ||
138 | 142 | | |||
139 | QVariant CatalogTreeModel::data(const QModelIndex& index, int role) const | 143 | QVariant CatalogTreeModel::data(const QModelIndex& index, int role) const | ||
140 | { | 144 | { | ||
141 | if (m_catalog->numberOfEntries() <= index.row()) | 145 | if (m_catalog->numberOfEntries() <= index.row()) | ||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 234 | case CatalogModelColumns::Notes: { | |||
232 | foreach (const Note ¬e, m_catalog->notes(index.row())) | 236 | foreach (const Note ¬e, m_catalog->notes(index.row())) | ||
233 | result += note.content; | 237 | result += note.content; | ||
234 | return result; | 238 | return result; | ||
235 | } | 239 | } | ||
236 | case CatalogModelColumns::Context: | 240 | case CatalogModelColumns::Context: | ||
237 | return m_catalog->context(index.row()); | 241 | return m_catalog->context(index.row()); | ||
238 | case CatalogModelColumns::Files: | 242 | case CatalogModelColumns::Files: | ||
239 | return m_catalog->sourceFiles(index.row()).join('|'); | 243 | return m_catalog->sourceFiles(index.row()).join('|'); | ||
244 | case CatalogModelColumns::SourceLength: | ||||
245 | return QString::number(m_catalog->msgidWithPlurals(index.row(), true).length()); | ||||
246 | case CatalogModelColumns::TargetLength: | ||||
247 | return QString::number(m_catalog->msgstrWithPlurals(index.row(), true).length()); | ||||
240 | default: | 248 | default: | ||
241 | return {}; | 249 | return {}; | ||
242 | } | 250 | } | ||
243 | } | 251 | } | ||
244 | 252 | | |||
245 | CatalogTreeModel::TranslationStatus CatalogTreeModel::getTranslationStatus(int row) const | 253 | CatalogTreeModel::TranslationStatus CatalogTreeModel::getTranslationStatus(int row) const | ||
246 | { | 254 | { | ||
247 | if (m_catalog->isEmpty(row)) { | 255 | if (m_catalog->isEmpty(row)) { | ||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |