NOISSUE do not re-create the logo icon every time it is requested

This caused significant lag.
This commit is contained in:
Petr Mrázek 2025-01-09 05:04:34 +01:00
parent ddedefe6d3
commit 8b65ad3aea
2 changed files with 4 additions and 6 deletions

View File

@ -17,6 +17,8 @@
#include <QFileInfo>
#include <xdgicon.h>
QIcon logoIcon = QIcon(":/logo.svg");
IconType operator--(IconType &t, int)
{
IconType temp = t;
@ -25,11 +27,8 @@ IconType operator--(IconType &t, int)
case IconType::Builtin:
t = IconType::ToBeDeleted;
break;
case IconType::Transient:
t = IconType::Builtin;
break;
case IconType::FileBased:
t = IconType::Transient;
t = IconType::Builtin;
break;
default:
{
@ -63,7 +62,7 @@ QIcon MMCIcon::icon() const
}
if(m_current_type == IconType::Builtin && m_key == "logo")
{
return QIcon(":/logo.svg");
return logoIcon;
}
auto & icon = m_images[m_current_type].icon;
if(!icon.isNull())

View File

@ -21,7 +21,6 @@
enum IconType : unsigned
{
Builtin,
Transient,
FileBased,
ICONS_TOTAL,
ToBeDeleted