Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdevelop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Friedrich W. H. Kossebau
kdevelop
Commits
78bf8aad
Commit
78bf8aad
authored
Dec 13, 2019
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quickopen: remove caching of project file icons, done by QIcon itself now
GIT_SILENT
parent
4fc86e6d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
21 deletions
+13
-21
plugins/quickopen/CMakeLists.txt
plugins/quickopen/CMakeLists.txt
+7
-1
plugins/quickopen/projectfilequickopen.cpp
plugins/quickopen/projectfilequickopen.cpp
+1
-19
plugins/quickopen/tests/CMakeLists.txt
plugins/quickopen/tests/CMakeLists.txt
+5
-1
No files found.
plugins/quickopen/CMakeLists.txt
View file @
78bf8aad
...
...
@@ -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
)
plugins/quickopen/projectfilequickopen.cpp
View file @
78bf8aad
...
...
@@ -22,7 +22,6 @@
#include <QIcon>
#include <QTextBrowser>
#include <KIconLoader>
#include <KLocalizedString>
#include <interfaces/iprojectcontroller.h>
...
...
@@ -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
<
QString
,
QPixmap
>
iconCache
;
QHash
<
QString
,
QPixmap
>::
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
...
...
plugins/quickopen/tests/CMakeLists.txt
View file @
78bf8aad
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment