Changeset View
Changeset View
Standalone View
Standalone View
src/panels/places/placesitemmodel.cpp
Show First 20 Lines • Show All 446 Lines • ▼ Show 20 Line(s) | 438 | for(int i = 0, iMax = m_sourceModel->rowCount(); i < iMax; i++) { | |||
---|---|---|---|---|---|
447 | // query yet. | 447 | // query yet. | ||
448 | const bool createDefaultViewProperties = item->isSearchOrTimelineUrl() && !GeneralSettings::self()->globalViewProps(); | 448 | const bool createDefaultViewProperties = item->isSearchOrTimelineUrl() && !GeneralSettings::self()->globalViewProps(); | ||
449 | if (createDefaultViewProperties) { | 449 | if (createDefaultViewProperties) { | ||
450 | const QUrl itemUrl = item->url(); | 450 | const QUrl itemUrl = item->url(); | ||
451 | ViewProperties props(KFilePlacesModel::convertedUrl(itemUrl)); | 451 | ViewProperties props(KFilePlacesModel::convertedUrl(itemUrl)); | ||
452 | if (!props.exist()) { | 452 | if (!props.exist()) { | ||
453 | const QString path = itemUrl.path(); | 453 | const QString path = itemUrl.path(); | ||
454 | if (path == QLatin1String("/documents")) { | 454 | if (path == QLatin1String("/documents")) { | ||
455 | props.setViewMode(DolphinView::DetailsView); | 455 | props.setViewMode(DolphinView::Mode::DetailsView); | ||
456 | props.setPreviewsShown(false); | 456 | props.setPreviewsShown(false); | ||
457 | props.setVisibleRoles({"text", "path"}); | 457 | props.setVisibleRoles({"text", "path"}); | ||
458 | } else if (path == QLatin1String("/images")) { | 458 | } else if (path == QLatin1String("/images")) { | ||
459 | props.setViewMode(DolphinView::IconsView); | 459 | props.setViewMode(DolphinView::Mode::IconsView); | ||
460 | props.setPreviewsShown(true); | 460 | props.setPreviewsShown(true); | ||
461 | props.setVisibleRoles({"text", "imageSize"}); | 461 | props.setVisibleRoles({"text", "imageSize"}); | ||
462 | } else if (path == QLatin1String("/audio")) { | 462 | } else if (path == QLatin1String("/audio")) { | ||
463 | props.setViewMode(DolphinView::DetailsView); | 463 | props.setViewMode(DolphinView::Mode::DetailsView); | ||
464 | props.setPreviewsShown(false); | 464 | props.setPreviewsShown(false); | ||
465 | props.setVisibleRoles({"text", "artist", "album"}); | 465 | props.setVisibleRoles({"text", "artist", "album"}); | ||
466 | } else if (path == QLatin1String("/videos")) { | 466 | } else if (path == QLatin1String("/videos")) { | ||
467 | props.setViewMode(DolphinView::IconsView); | 467 | props.setViewMode(DolphinView::Mode::IconsView); | ||
468 | props.setPreviewsShown(true); | 468 | props.setPreviewsShown(true); | ||
469 | props.setVisibleRoles({"text"}); | 469 | props.setVisibleRoles({"text"}); | ||
470 | } else if (itemUrl.scheme() == QLatin1String("timeline")) { | 470 | } else if (itemUrl.scheme() == QLatin1String("timeline")) { | ||
471 | props.setViewMode(DolphinView::DetailsView); | 471 | props.setViewMode(DolphinView::Mode::DetailsView); | ||
472 | props.setVisibleRoles({"text", "modificationtime"}); | 472 | props.setVisibleRoles({"text", "modificationtime"}); | ||
473 | } | 473 | } | ||
474 | props.save(); | 474 | props.save(); | ||
475 | } | 475 | } | ||
476 | } | 476 | } | ||
477 | } | 477 | } | ||
478 | } | 478 | } | ||
479 | 479 | | |||
▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines |