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