Changeset View
Changeset View
Standalone View
Standalone View
src/core/itemsmodel.cpp
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
47 | { | 47 | { | ||
48 | if (role != Qt::UserRole) { | 48 | if (role != Qt::UserRole) { | ||
49 | return QVariant(); | 49 | return QVariant(); | ||
50 | } | 50 | } | ||
51 | EntryInternal entry = m_entries[index.row()]; | 51 | EntryInternal entry = m_entries[index.row()]; | ||
52 | return QVariant::fromValue(entry); | 52 | return QVariant::fromValue(entry); | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | int ItemsModel::row(const EntryInternal& entry) const | ||||
56 | { | ||||
57 | return m_entries.indexOf(entry); | ||||
58 | } | ||||
59 | | ||||
55 | void ItemsModel::slotEntriesLoaded(const KNSCore::EntryInternal::List& entries) | 60 | void ItemsModel::slotEntriesLoaded(const KNSCore::EntryInternal::List& entries) | ||
56 | { | 61 | { | ||
57 | for (const KNSCore::EntryInternal &entry : entries) { | 62 | for (const KNSCore::EntryInternal &entry : entries) { | ||
58 | addEntry(entry); | 63 | addEntry(entry); | ||
59 | } | 64 | } | ||
60 | } | 65 | } | ||
61 | 66 | | |||
62 | void ItemsModel::addEntry(const EntryInternal &entry) | 67 | void ItemsModel::addEntry(const EntryInternal &entry) | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |