diff --git a/plugins/quickopen/CMakeLists.txt b/plugins/quickopen/CMakeLists.txt index 99af7fdf9f4104ad3bf01ae4fade8b440109508e..277f2b8350218cb7bdf5f717ef980566f38053d9 100644 --- a/plugins/quickopen/CMakeLists.txt +++ b/plugins/quickopen/CMakeLists.txt @@ -27,4 +27,10 @@ ki18n_wrap_ui(kdevquickopen_PART_SRCS ) qt5_add_resources(kdevquickopen_PART_SRCS kdevquickopen.qrc) kdevplatform_add_plugin(kdevquickopen JSON kdevquickopen.json SOURCES ${kdevquickopen_PART_SRCS}) -target_link_libraries(kdevquickopen KF5::IconThemes KF5::GuiAddons KF5::TextEditor KDev::Language KDev::Interfaces KDev::Project KDev::Util) +target_link_libraries(kdevquickopen + KDev::Language + KDev::Interfaces + KDev::Project + KDev::Util + KF5::GuiAddons +) diff --git a/plugins/quickopen/projectfilequickopen.cpp b/plugins/quickopen/projectfilequickopen.cpp index 43192bc8cf1c07af1be8fa832cb1889af91e85de..6b0ac0ff5cdf5e9acaf9322d45716ac954abe3d0 100644 --- a/plugins/quickopen/projectfilequickopen.cpp +++ b/plugins/quickopen/projectfilequickopen.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -164,24 +163,7 @@ QWidget* ProjectFileData::expandingWidget() const QIcon ProjectFileData::icon() const { - const QString& iconName = iconNameForUrl(m_file.indexedPath); - - /** - * FIXME: Move this cache into a more central place and reuse it elsewhere. - * The project model e.g. could reuse this as well. - * - * Note: We cache here since otherwise displaying and esp. scrolling - * in a large list of quickopen items becomes very slow. - */ - static QHash iconCache; - QHash::const_iterator it = iconCache.constFind(iconName); - if (it != iconCache.constEnd()) { - return it.value(); - } - - const QPixmap& pixmap = KIconLoader::global()->loadIcon(iconName, KIconLoader::Small); - iconCache.insert(iconName, pixmap); - return pixmap; + return QIcon::fromTheme(iconNameForUrl(m_file.indexedPath)); } QString ProjectFileData::project() const diff --git a/plugins/quickopen/tests/CMakeLists.txt b/plugins/quickopen/tests/CMakeLists.txt index 86c0458c5380389a91ca9bd345ff047c0ddd7151..16a7ec6e13f3a1972eb289d2342d0d3bf468e8f6 100644 --- a/plugins/quickopen/tests/CMakeLists.txt +++ b/plugins/quickopen/tests/CMakeLists.txt @@ -9,7 +9,11 @@ add_library(quickopentestbase STATIC ../projectfilequickopen.cpp) target_link_libraries(quickopentestbase PUBLIC - Qt5::Test KF5::IconThemes KDev::Tests KDev::Project KDev::Language) + KDev::Tests + KDev::Project + KDev::Language + Qt5::Test +) ecm_add_test(test_quickopen.cpp LINK_LIBRARIES quickopentestbase)