mirror of
https://github.com/tnodir/fort
synced 2024-11-15 11:25:08 +00:00
UI: IconCache: Microoptimize file()
This commit is contained in:
parent
d824118bbc
commit
7ea1d5247b
@ -51,6 +51,8 @@ QPixmap IconCache::file(const QString &filePath)
|
|||||||
{
|
{
|
||||||
checkThread();
|
checkThread();
|
||||||
|
|
||||||
|
QPixmap pixmap;
|
||||||
|
if (!find(filePath, &pixmap)) {
|
||||||
QString adjustedFilePath = filePath;
|
QString adjustedFilePath = filePath;
|
||||||
|
|
||||||
// Try to use "./icons/" folder from current working dir.
|
// Try to use "./icons/" folder from current working dir.
|
||||||
@ -62,10 +64,9 @@ QPixmap IconCache::file(const QString &filePath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap pixmap;
|
|
||||||
if (!find(adjustedFilePath, &pixmap)) {
|
|
||||||
pixmap.load(adjustedFilePath);
|
pixmap.load(adjustedFilePath);
|
||||||
insert(adjustedFilePath, pixmap);
|
|
||||||
|
insert(filePath, pixmap);
|
||||||
}
|
}
|
||||||
return pixmap;
|
return pixmap;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user