Use KFileItem::text() instead of KFileItem::name().

This way Nepomuk search results get their proper user readable names.
BUG: 287472
REVIEW: 103237
This commit is contained in:
Sebastian Trueg 2011-11-25 16:02:49 +01:00
parent 3950eccaf0
commit 93cc480803
3 changed files with 4 additions and 4 deletions

View file

@ -425,9 +425,9 @@ void DolphinViewContainer::showItemInfo(const KFileItem& item)
} else {
QString message;
if (item.isDir()) {
message = item.name();
message = item.text();
} else {
message = i18nc("@info:status filename (type)", "%1 (%2)", item.name(), item.mimeComment());
message = i18nc("@info:status filename (type)", "%1 (%2)", item.text(), item.mimeComment());
}
m_statusBar->setMessage(message, DolphinStatusBar::Default);
}

View file

@ -953,7 +953,7 @@ QHash<QByteArray, QVariant> KFileItemModel::retrieveData(const KFileItem& item)
}
if (m_requestRole[NameRole]) {
data.insert("name", item.name());
data.insert("name", item.text());
}
if (m_requestRole[SizeRole]) {

View file

@ -339,7 +339,7 @@ void DolphinView::setItemSelectionEnabled(const QRegExp& pattern, bool enabled)
for (int index = 0; index < model->count(); index++) {
const KFileItem item = model->fileItem(index);
if (pattern.exactMatch(item.name())) {
if (pattern.exactMatch(item.text())) {
// An alternative approach would be to store the matching items in a QSet<int> and
// select them in one go after the loop, but we'd need a new function
// KItemListSelectionManager::setSelected(QSet<int>, SelectionMode mode)