Commit 215b399f authored by Méven Car's avatar Méven Car Committed by Nate Graham
Browse files

FileEntry: don't exec stat potentially blocking

Partial revert of 86517407


(cherry picked from commit 0a1fe09b)
parent 0ddd2048
Pipeline #237257 passed with stage
in 11 minutes and 29 seconds
......@@ -19,16 +19,10 @@ FileEntry::FileEntry(AbstractModel *owner, const QUrl &url, const QString &mimeT
: AbstractEntry(owner)
, m_fileItem(nullptr)
{
if (url.isValid()) {
if (url.isLocalFile()) {
m_fileItem = new KFileItem(url, mimeType);
m_fileItem->determineMimeType();
} else {
KIO::StatJob *job = KIO::statDetails(url, KIO::StatJob::SourceSide, KIO::StatBasic, KIO::JobFlag::HideProgressInfo);
if (job->exec()) {
m_fileItem = new KFileItem(job->statResult(), url);
}
}
if (url.isValid() && url.isLocalFile()) {
m_fileItem = new KFileItem(url, mimeType);
m_fileItem->determineMimeType();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment