Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/plugins/folder/foldermodel.cpp
Show First 20 Lines • Show All 1107 Lines • ▼ Show 20 Line(s) | 1103 | { | |||
---|---|---|---|---|---|
1108 | 1108 | | |||
1109 | if (m_parseDesktopFiles && item.isDesktopFile()) { | 1109 | if (m_parseDesktopFiles && item.isDesktopFile()) { | ||
1110 | // Check if the desktop file is a link to a directory | 1110 | // Check if the desktop file is a link to a directory | ||
1111 | KDesktopFile file(item.targetUrl().path()); | 1111 | KDesktopFile file(item.targetUrl().path()); | ||
1112 | 1112 | | |||
1113 | if (file.readType() == QLatin1String("Link")) { | 1113 | if (file.readType() == QLatin1String("Link")) { | ||
1114 | const QUrl url(file.readUrl()); | 1114 | const QUrl url(file.readUrl()); | ||
1115 | 1115 | | |||
1116 | if (url.isLocalFile()) { | 1116 | if (!m_isDirCache.contains(item.url()) && KProtocolInfo::protocolClass(url.scheme()) == QStringLiteral(":local")) { | ||
1117 | QT_STATBUF buf; | | |||
1118 | const QString path = url.adjusted(QUrl::StripTrailingSlash).toLocalFile(); | | |||
1119 | if (QT_STAT(QFile::encodeName(path).constData(), &buf) == 0) { | | |||
1120 | return S_ISDIR(buf.st_mode); | | |||
1121 | } | | |||
1122 | } else if (!m_isDirCache.contains(item.url()) && KProtocolInfo::protocolClass(url.scheme()) == QStringLiteral(":local")) { | | |||
1123 | KIO::StatJob *job = KIO::stat(url, KIO::HideProgressInfo); | 1117 | KIO::StatJob *job = KIO::stat(url, KIO::HideProgressInfo); | ||
1124 | job->setProperty("org.kde.plasma.folder_url", item.url()); | 1118 | job->setProperty("org.kde.plasma.folder_url", item.url()); | ||
1125 | job->setSide(KIO::StatJob::SourceSide); | 1119 | job->setSide(KIO::StatJob::SourceSide); | ||
1126 | job->setDetails(0); | 1120 | job->setDetails(0); | ||
1127 | connect(job, &KJob::result, this, &FolderModel::statResult); | 1121 | connect(job, &KJob::result, this, &FolderModel::statResult); | ||
1128 | } | 1122 | } | ||
1129 | } | 1123 | } | ||
1130 | } | 1124 | } | ||
▲ Show 20 Lines • Show All 552 Lines • Show Last 20 Lines |