forked from qt-creator/qt-creator
FileIconProvider: Load icons and create overlay lazily
If the icon is registered via file path, not the icon directly, we can delay loading the icon and creating the overlay to until it is actually needed. Change-Id: Icfdc30ac0b717ff566a1064e4791e4bb23814958 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -296,14 +296,14 @@ void CppEditorPlugin::extensionsInitialized()
|
||||
|
||||
if (!HostOsInfo::isMacHost() && !HostOsInfo::isWindowsHost()) {
|
||||
FileIconProvider::registerIconOverlayForMimeType(
|
||||
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCppSource, QLatin1String(":/cppeditor/images/qt_cpp.png"))),
|
||||
CppTools::Constants::CPP_SOURCE_MIMETYPE);
|
||||
creatorTheme()->imageFile(Theme::IconOverlayCppSource, ":/cppeditor/images/qt_cpp.png"),
|
||||
CppTools::Constants::CPP_SOURCE_MIMETYPE);
|
||||
FileIconProvider::registerIconOverlayForMimeType(
|
||||
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCSource, QLatin1String(":/cppeditor/images/qt_c.png"))),
|
||||
CppTools::Constants::C_SOURCE_MIMETYPE);
|
||||
creatorTheme()->imageFile(Theme::IconOverlayCSource, ":/cppeditor/images/qt_c.png"),
|
||||
CppTools::Constants::C_SOURCE_MIMETYPE);
|
||||
FileIconProvider::registerIconOverlayForMimeType(
|
||||
QIcon(creatorTheme()->imageFile(Theme::IconOverlayCppHeader, QLatin1String(":/cppeditor/images/qt_h.png"))),
|
||||
CppTools::Constants::CPP_HEADER_MIMETYPE);
|
||||
creatorTheme()->imageFile(Theme::IconOverlayCppHeader, ":/cppeditor/images/qt_h.png"),
|
||||
CppTools::Constants::CPP_HEADER_MIMETYPE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user