MessageViewer::IconNameCache Class
This class is a replacement for KIconLoader::iconPath(). More...
| Header: | #include <MessageViewer/IconNameCache> |
| CMake: | find_package(KPim6MessageViewer REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::MessageViewer) |
Public Functions
| QString | iconPath(const QString &name, int size) const |
| QString | iconPathFromLocal(const QString &name) const |
Static Public Members
| MessageViewer::IconNameCache * | instance() |
Detailed Description
This class is a replacement for KIconLoader::iconPath(), because the iconPath() function can be slow for non-existing icons or icons that fall back to a generic icon. Reason is that KIconLoader does slow system calls for finding the icons.
The IconNameCache caches the result of iconPath() in a map and solves the slowness.