Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/plugins/folder/foldermodel.cpp
Show First 20 Lines • Show All 486 Lines • ▼ Show 20 Line(s) | |||||
487 | } | 487 | } | ||
488 | 488 | | |||
489 | void FolderModel::cd(int row) | 489 | void FolderModel::cd(int row) | ||
490 | { | 490 | { | ||
491 | if (row < 0) { | 491 | if (row < 0) { | ||
492 | return; | 492 | return; | ||
493 | } | 493 | } | ||
494 | 494 | | |||
495 | KFileItem item = itemForIndex(index(row, 0)); | 495 | const QModelIndex idx = index(row, 0); | ||
496 | bool isDir = data(idx, IsDirRole).toBool(); | ||||
496 | 497 | | |||
497 | if (item.isDir()) { | 498 | if (isDir) { | ||
499 | const KFileItem item = itemForIndex(idx); | ||||
500 | if (m_parseDesktopFiles && item.isDesktopFile()) { | ||||
501 | const KDesktopFile file(item.targetUrl().path()); | ||||
502 | if (file.readType() == QLatin1String("Link")) { | ||||
503 | setUrl(file.readUrl()); | ||||
504 | } | ||||
505 | } | ||||
506 | else { | ||||
498 | setUrl(item.url().toString()); | 507 | setUrl(item.url().toString()); | ||
499 | } | 508 | } | ||
500 | } | 509 | } | ||
510 | } | ||||
501 | 511 | | |||
502 | void FolderModel::run(int row) | 512 | void FolderModel::run(int row) | ||
503 | { | 513 | { | ||
504 | if (row < 0) { | 514 | if (row < 0) { | ||
505 | return; | 515 | return; | ||
506 | } | 516 | } | ||
507 | 517 | | |||
508 | KFileItem item = itemForIndex(index(row, 0)); | 518 | KFileItem item = itemForIndex(index(row, 0)); | ||
▲ Show 20 Lines • Show All 1059 Lines • Show Last 20 Lines |