UI: Special icon for "System" app.

This commit is contained in:
Nodir Temirkhodjaev 2019-04-22 15:07:51 +05:00
parent ea11d78341
commit 62bae6843d
3 changed files with 15 additions and 0 deletions

View File

@ -32,6 +32,7 @@
<file>images/sheild-96.png</file>
<file>images/textfield_rename.png</file>
<file>images/tick.png</file>
<file>images/windows-48.png</file>
<file>images/world.png</file>
<file>images/world_link.png</file>
</qresource>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -121,15 +121,29 @@ bool extractVersionInfo(const QString &appPath, AppInfo &appInfo)
return true;
}
bool isSystemApp(const QString &appPath)
{
return appPath.compare("System", Qt::CaseInsensitive) == 0;
}
}
bool AppUtil::getInfo(const QString &appPath, AppInfo &appInfo)
{
if (isSystemApp(appPath)) {
appInfo.fileDescription = appPath;
return true;
}
return extractVersionInfo(appPath, appInfo);
}
QImage AppUtil::getIcon(const QString &appPath)
{
if (isSystemApp(appPath)) {
return QImage(":/images/windows-48.png");
}
return extractShellIcon(appPath)
.toImage();
}