Commit 2b1cd557 authored by Laurent Montel's avatar Laurent Montel 😁

Cache icon size

parent c1ebdba4
......@@ -572,7 +572,7 @@ public:
if (mp->mAsIcon != MimeTreeParser::NoIcon) {
t = MessageViewer::MessagePartRendererManager::self()->loadByName(QStringLiteral(":/asiconpart.html"));
block.setProperty("iconSize", KIconLoader::global()->currentSize(KIconLoader::Desktop));
block.setProperty("iconSize", MessageViewer::MessagePartRendererManager::self()->iconCurrentSize());
block.setProperty("inline", (mp->mAsIcon == MimeTreeParser::IconInline));
QString iconPath;
......
......@@ -118,6 +118,7 @@ void MessagePartRendererManager::initializeRenderer()
if (!m_localized) {
m_localized.reset(new GrantleeTheme::GrantleeKi18nLocalizer());
}
mCurrentIconSize = KIconLoader::global()->currentSize(KIconLoader::Desktop);
}
Grantlee::Template MessagePartRendererManager::loadByName(const QString &name)
......@@ -136,3 +137,8 @@ Grantlee::Context MessagePartRendererManager::createContext()
c.setLocalizer(m_localized);
return c;
}
int MessagePartRendererManager::iconCurrentSize() const
{
return mCurrentIconSize;
}
......@@ -45,10 +45,12 @@ public:
Grantlee::Template loadByName(const QString &name);
Grantlee::Context createContext();
int iconCurrentSize() const;
private:
void initializeRenderer();
Grantlee::Engine *m_engine;
QSharedPointer<GrantleeTheme::GrantleeKi18nLocalizer> m_localized;
int mCurrentIconSize;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment