Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Dan Leinir Turthra Jensen
Plasma Desktop
Commits
6fa8a6b1
Commit
6fa8a6b1
authored
Jun 23, 2020
by
Méven Car
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KCM component chooser: use the category FileManager to filter filemanager apps
BUG: 423313 FIXED-IN: 5.19.2
parent
70c4eb3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
kcms/componentchooser/componentchooserfilemanager.cpp
kcms/componentchooser/componentchooserfilemanager.cpp
+7
-3
No files found.
kcms/componentchooser/componentchooserfilemanager.cpp
View file @
6fa8a6b1
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "componentchooserfilemanager.h"
#include "componentchooserfilemanager.h"
#include <kprocess.h>
#include <kprocess.h>
#include <kmimetypetrader.h>
#include <kmimetypetrader.h>
#include <K
ServiceType
Trader>
#include <K
Application
Trader>
#include <kopenwithdialog.h>
#include <kopenwithdialog.h>
#include <kconfiggroup.h>
#include <kconfiggroup.h>
#include <QStandardPaths>
#include <QStandardPaths>
...
@@ -78,8 +78,12 @@ void CfgFileManager::load(KConfig *)
...
@@ -78,8 +78,12 @@ void CfgFileManager::load(KConfig *)
const
KService
::
Ptr
fileManager
=
KMimeTypeTrader
::
self
()
->
preferredService
(
mime
);
const
KService
::
Ptr
fileManager
=
KMimeTypeTrader
::
self
()
->
preferredService
(
mime
);
const
auto
constraint
=
QStringLiteral
(
"'FileManager' in Categories and 'inode/directory' in ServiceTypes"
);
const
auto
fileManagers
=
KApplicationTrader
::
query
([]
(
const
KService
::
Ptr
&
service
)
{
const
KService
::
List
fileManagers
=
KServiceTypeTrader
::
self
()
->
query
(
QStringLiteral
(
"Application"
),
constraint
);
if
(
service
->
exec
().
isEmpty
())
{
return
false
;
}
return
service
->
categories
().
contains
(
"FileManager"
);
});
for
(
const
KService
::
Ptr
&
service
:
fileManagers
)
{
for
(
const
KService
::
Ptr
&
service
:
fileManagers
)
{
addItem
(
QIcon
::
fromTheme
(
service
->
icon
()),
service
->
name
(),
service
->
storageId
());
addItem
(
QIcon
::
fromTheme
(
service
->
icon
()),
service
->
name
(),
service
->
storageId
());
...
...
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