mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdeui: KImageIO optimizations
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e4a9f1c9e1
commit
cd2fd94c99
1 changed files with 4 additions and 6 deletions
|
@ -19,7 +19,7 @@ QString KImageIO::pattern(Mode mode)
|
|||
{
|
||||
QStringList patterns;
|
||||
QString allPatterns;
|
||||
QString separator("|");
|
||||
static const QLatin1Char separator('|');
|
||||
|
||||
foreach(const QString &mimeType, KImageIO::mimeTypes(mode)) {
|
||||
KMimeType::Ptr mime = KMimeType::mimeType(mimeType);
|
||||
|
@ -47,9 +47,9 @@ QStringList KImageIO::typeForMime(const QString &mimeType)
|
|||
if (mimeType.isEmpty()) {
|
||||
return result;
|
||||
}
|
||||
const QByteArray latinType = QImageReader::formatForMimeType(mimeType.toLatin1());
|
||||
if (!latinType.isEmpty()) {
|
||||
result << latinType;
|
||||
const QByteArray format = QImageReader::formatForMimeType(mimeType.toLatin1());
|
||||
if (!format.isEmpty()) {
|
||||
result << QString::fromLatin1(format.constData());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -89,12 +89,10 @@ bool KImageIO::isSupported(const QString& mimeType, Mode mode)
|
|||
if (mimeType.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach(const QString &mime, KImageIO::mimeTypes(mode)) {
|
||||
if (mimeType == mime) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue