Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
System
Dolphin
Commits
dafa1e1f
Commit
dafa1e1f
authored
Dec 27, 2021
by
Alexander Lohnau
Browse files
Utilize KIO::PreviewJob::availableThumbnailerPlugins method to fetch available preview plugins
parent
9185c512
Pipeline
#118627
passed with stage
in 6 minutes and 10 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/settings/general/previewssettingspage.cpp
View file @
dafa1e1f
...
...
@@ -168,17 +168,17 @@ void PreviewsSettingsPage::loadPreviewPlugins()
{
QAbstractItemModel
*
model
=
m_listView
->
model
();
const
KService
::
List
plugins
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"ThumbCreator"
)
);
for
(
const
K
Service
::
Ptr
&
service
:
plugins
)
{
const
bool
configurable
=
service
->
property
(
QStringLiteral
(
"Configurable"
),
QVariant
::
Bool
).
toBool
(
);
const
bool
show
=
m_enabledPreviewPlugins
.
contains
(
service
->
desktopEntryName
());
const
QVector
<
KPluginMetaData
>
plugins
=
KIO
::
PreviewJob
::
availableThumbnailerPlugins
(
);
for
(
const
K
PluginMetaData
&
plugin
:
plugins
)
{
const
bool
configurable
=
plugin
.
value
(
QStringLiteral
(
"Configurable"
),
false
);
const
bool
show
=
m_enabledPreviewPlugins
.
contains
(
plugin
.
pluginId
());
model
->
insertRow
(
0
);
const
QModelIndex
index
=
model
->
index
(
0
,
0
);
model
->
setData
(
index
,
show
,
Qt
::
CheckStateRole
);
model
->
setData
(
index
,
configurable
,
ServiceModel
::
ConfigurableRole
);
model
->
setData
(
index
,
service
->
name
(),
Qt
::
DisplayRole
);
model
->
setData
(
index
,
service
->
desktopEntryName
(),
ServiceModel
::
DesktopEntryNameRole
);
model
->
setData
(
index
,
plugin
.
name
(),
Qt
::
DisplayRole
);
model
->
setData
(
index
,
plugin
.
pluginId
(),
ServiceModel
::
DesktopEntryNameRole
);
}
model
->
sort
(
Qt
::
DisplayRole
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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