mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
gwenview: adjust to KIO changes
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3445330ed4
commit
e918508d04
1 changed files with 4 additions and 2 deletions
|
@ -65,10 +65,12 @@ QString urlMimeType(const KUrl& url)
|
||||||
// Try a simple guess, using extension for remote urls
|
// Try a simple guess, using extension for remote urls
|
||||||
QString mimeType = KMimeType::findByUrl(url)->name();
|
QString mimeType = KMimeType::findByUrl(url)->name();
|
||||||
if (mimeType == "application/octet-stream") {
|
if (mimeType == "application/octet-stream") {
|
||||||
kDebug() << "KMimeType::findByUrl() failed to find mimetype for" << url << ". Falling back to KIO::NetAccess::mimetype().";
|
kDebug() << "KMimeType::findByUrl() failed to find mimetype for" << url << ". Falling back to KIO::stat().";
|
||||||
// No luck, look deeper. This can happens with http urls if the filename
|
// No luck, look deeper. This can happens with http urls if the filename
|
||||||
// does not provide any extension.
|
// does not provide any extension.
|
||||||
mimeType = KIO::NetAccess::mimetype(url, KApplication::kApplication()->activeWindow());
|
KIO::UDSEntry statentry;
|
||||||
|
KIO::NetAccess::stat(url, statentry, KApplication::kApplication()->activeWindow());
|
||||||
|
mimeType = statentry.stringValue(KIO::UDSEntry::UDS_MIME_TYPE);
|
||||||
}
|
}
|
||||||
return mimeType;
|
return mimeType;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue