mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 10:22:52 +00:00
ark: pass the device to KMimeType::findByNameAndContent()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6260843dde
commit
677eeea1ae
1 changed files with 1 additions and 6 deletions
|
@ -55,12 +55,7 @@ static QString determineMimeType(const QString& filename)
|
|||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
const qint64 maxSize = 0x100000; // 1MB
|
||||
const qint64 bufferSize = qMin(maxSize, file.size());
|
||||
const QByteArray buffer = file.read(bufferSize);
|
||||
|
||||
return KMimeType::findByNameAndContent(filename, buffer)->name();
|
||||
return KMimeType::findByNameAndContent(filename, &file)->name();
|
||||
}
|
||||
|
||||
static KService::List findPluginOffers(const QString& filename, const QString& fixedMimeType)
|
||||
|
|
Loading…
Add table
Reference in a new issue