Changeset View
Changeset View
Standalone View
Standalone View
src/core/models/entitytreemodel.cpp
Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Line(s) | 274 | if (Node::Collection == node->type) { | |||
---|---|---|---|---|---|
312 | } | 312 | } | ||
313 | case OriginalCollectionNameRole: { | 313 | case OriginalCollectionNameRole: { | ||
314 | return entityData(collection, index.column(), Qt::DisplayRole); | 314 | return entityData(collection, index.column(), Qt::DisplayRole); | ||
315 | } | 315 | } | ||
316 | case PendingCutRole: | 316 | case PendingCutRole: | ||
317 | return d->m_pendingCutCollections.contains(node->id); | 317 | return d->m_pendingCutCollections.contains(node->id); | ||
318 | case Qt::BackgroundRole: { | 318 | case Qt::BackgroundRole: { | ||
319 | if (collection.hasAttribute<EntityDisplayAttribute>()) { | 319 | if (collection.hasAttribute<EntityDisplayAttribute>()) { | ||
320 | EntityDisplayAttribute *eda = collection.attribute<EntityDisplayAttribute>(); | 320 | const EntityDisplayAttribute *eda = collection.attribute<EntityDisplayAttribute>(); | ||
321 | QColor color = eda->backgroundColor(); | 321 | QColor color = eda->backgroundColor(); | ||
322 | if (color.isValid()) { | 322 | if (color.isValid()) { | ||
323 | return color; | 323 | return color; | ||
324 | } | 324 | } | ||
325 | } | 325 | } | ||
326 | // fall through. | 326 | // fall through. | ||
327 | Q_FALLTHROUGH(); | 327 | Q_FALLTHROUGH(); | ||
328 | } | 328 | } | ||
Show All 34 Lines | 361 | case AvailablePartsRole: | |||
363 | break; | 363 | break; | ||
364 | case EntityUrlRole: | 364 | case EntityUrlRole: | ||
365 | return item.url(Akonadi::Item::UrlWithMimeType).url(); | 365 | return item.url(Akonadi::Item::UrlWithMimeType).url(); | ||
366 | break; | 366 | break; | ||
367 | case PendingCutRole: | 367 | case PendingCutRole: | ||
368 | return d->m_pendingCutItems.contains(node->id); | 368 | return d->m_pendingCutItems.contains(node->id); | ||
369 | case Qt::BackgroundRole: { | 369 | case Qt::BackgroundRole: { | ||
370 | if (item.hasAttribute<EntityDisplayAttribute>()) { | 370 | if (item.hasAttribute<EntityDisplayAttribute>()) { | ||
371 | EntityDisplayAttribute *eda = item.attribute<EntityDisplayAttribute>(); | 371 | const EntityDisplayAttribute *eda = item.attribute<EntityDisplayAttribute>(); | ||
372 | const QColor color = eda->backgroundColor(); | 372 | const QColor color = eda->backgroundColor(); | ||
373 | if (color.isValid()) { | 373 | if (color.isValid()) { | ||
374 | return color; | 374 | return color; | ||
375 | } | 375 | } | ||
376 | } | 376 | } | ||
377 | // fall through. | 377 | // fall through. | ||
378 | Q_FALLTHROUGH(); | 378 | Q_FALLTHROUGH(); | ||
379 | } | 379 | } | ||
▲ Show 20 Lines • Show All 852 Lines • Show Last 20 Lines |