Changeset View
Changeset View
Standalone View
Standalone View
src/ui/itemsviewbasedelegate.cpp
Context not available. | |||||
18 | */ | 18 | */ | ||
---|---|---|---|---|---|
19 | #include "itemsviewbasedelegate_p.h" | 19 | #include "itemsviewbasedelegate_p.h" | ||
20 | 20 | | |||
21 | #include "itemsmodel_p.h" | 21 | #include "core/itemsmodel_p.h" | ||
22 | | ||||
22 | #include "entrydetailsdialog_p.h" | 23 | #include "entrydetailsdialog_p.h" | ||
23 | 24 | | |||
24 | #include <knewstuff_debug.h> | 25 | #include <knewstuff_debug.h> | ||
Context not available. | |||||
27 | 28 | | |||
28 | namespace KNS3 | 29 | namespace KNS3 | ||
29 | { | 30 | { | ||
30 | ItemsViewBaseDelegate::ItemsViewBaseDelegate(QAbstractItemView *itemView, Engine *engine, QObject *parent) | 31 | ItemsViewBaseDelegate::ItemsViewBaseDelegate(QAbstractItemView *itemView, KNSCore::Engine *engine, QObject *parent) | ||
31 | : KWidgetItemDelegate(itemView, parent) | 32 | : KWidgetItemDelegate(itemView, parent) | ||
32 | , m_engine(engine) | 33 | , m_engine(engine) | ||
33 | , m_itemView(itemView) | 34 | , m_itemView(itemView) | ||
Context not available. | |||||
61 | QModelIndex index = focusedIndex(); | 62 | QModelIndex index = focusedIndex(); | ||
62 | Q_ASSERT(index.isValid()); | 63 | Q_ASSERT(index.isValid()); | ||
63 | 64 | | |||
64 | KNS3::EntryInternal entry = index.data(Qt::UserRole).value<KNS3::EntryInternal>(); | 65 | KNSCore::EntryInternal entry = index.data(Qt::UserRole).value<KNSCore::EntryInternal>(); | ||
65 | m_engine->contactAuthor(entry); | 66 | m_engine->contactAuthor(entry); | ||
66 | } | 67 | } | ||
67 | 68 | | |||
Context not available. | |||||
69 | { | 70 | { | ||
70 | QModelIndex index = focusedIndex(); | 71 | QModelIndex index = focusedIndex(); | ||
71 | if (index.isValid()) { | 72 | if (index.isValid()) { | ||
72 | KNS3::EntryInternal entry = index.data(Qt::UserRole).value<KNS3::EntryInternal>(); | 73 | KNSCore::EntryInternal entry = index.data(Qt::UserRole).value<KNSCore::EntryInternal>(); | ||
73 | if (!entry.isValid()) { | 74 | if (!entry.isValid()) { | ||
74 | qCDebug(KNEWSTUFF) << "Invalid entry: " << entry.name(); | 75 | qCDebug(KNEWSTUFF) << "Invalid entry: " << entry.name(); | ||
75 | return; | 76 | return; | ||
Context not available. | |||||
89 | int row = rowDownload.x(); | 90 | int row = rowDownload.x(); | ||
90 | QModelIndex index = m_itemView->model()->index(row, 0); | 91 | QModelIndex index = m_itemView->model()->index(row, 0); | ||
91 | if (index.isValid()) { | 92 | if (index.isValid()) { | ||
92 | KNS3::EntryInternal entry = index.data(Qt::UserRole).value<KNS3::EntryInternal>(); | 93 | KNSCore::EntryInternal entry = index.data(Qt::UserRole).value<KNSCore::EntryInternal>(); | ||
93 | m_engine->install(entry, rowDownload.y()); | 94 | m_engine->install(entry, rowDownload.y()); | ||
94 | } | 95 | } | ||
95 | } | 96 | } | ||
Context not available. | |||||
103 | void ItemsViewBaseDelegate::slotDetailsClicked(const QModelIndex &index) | 104 | void ItemsViewBaseDelegate::slotDetailsClicked(const QModelIndex &index) | ||
104 | { | 105 | { | ||
105 | if (index.isValid()) { | 106 | if (index.isValid()) { | ||
106 | KNS3::EntryInternal entry = index.data(Qt::UserRole).value<KNS3::EntryInternal>(); | 107 | KNSCore::EntryInternal entry = index.data(Qt::UserRole).value<KNSCore::EntryInternal>(); | ||
107 | if (!entry.isValid()) { | 108 | if (!entry.isValid()) { | ||
108 | return; | 109 | return; | ||
109 | } | 110 | } | ||
Context not available. |