Changeset View
Changeset View
Standalone View
Standalone View
src/sortmodel.cpp
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Line(s) | 257 | { | |||
---|---|---|---|---|---|
261 | return -1; | 261 | return -1; | ||
262 | } | 262 | } | ||
263 | 263 | | |||
264 | int SortModel::sourceIndex(const int& indexValue) | 264 | int SortModel::sourceIndex(const int& indexValue) | ||
265 | { | 265 | { | ||
266 | return mapToSource( index(indexValue, 0, QModelIndex())).row(); | 266 | return mapToSource( index(indexValue, 0, QModelIndex())).row(); | ||
267 | } | 267 | } | ||
268 | 268 | | |||
269 | QJsonArray SortModel::selectedImages() | ||||
270 | { | ||||
271 | QJsonArray arr; | ||||
272 | | ||||
273 | foreach( QModelIndex index, m_selectionModel->selectedIndexes()) | ||||
274 | { | ||||
275 | arr.push_back( QJsonValue (data( index, Roles::ImageUrlRole).toString())); | ||||
276 | } | ||||
277 | | ||||
278 | return arr; | ||||
279 | } | ||||
280 | | ||||
269 | void SortModel::delayedPreview() | 281 | void SortModel::delayedPreview() | ||
270 | { | 282 | { | ||
271 | QHash<QUrl, QPersistentModelIndex>::const_iterator i = m_filesToPreview.constBegin(); | 283 | QHash<QUrl, QPersistentModelIndex>::const_iterator i = m_filesToPreview.constBegin(); | ||
272 | 284 | | |||
273 | KFileItemList list; | 285 | KFileItemList list; | ||
274 | 286 | | |||
275 | while (i != m_filesToPreview.constEnd()) { | 287 | while (i != m_filesToPreview.constEnd()) { | ||
276 | QUrl file = i.key(); | 288 | QUrl file = i.key(); | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |