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
Utilities
KFind
Commits
8a06109c
Commit
8a06109c
authored
Apr 09, 2021
by
David Faure
Browse files
Port from deprecated KRun to KIO::OpenUrlJob.
Tested with click-on-item and RMB/Open.
parent
09896892
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kfindtreeview.cpp
View file @
8a06109c
...
@@ -27,12 +27,12 @@
...
@@ -27,12 +27,12 @@
#include
<KLocalizedString>
#include
<KLocalizedString>
#include
<KMessageBox>
#include
<KMessageBox>
#include
<KPropertiesDialog>
#include
<KPropertiesDialog>
#include
<KRun>
#include
<KIO/CopyJob>
#include
<KIO/CopyJob>
#include
<KIO/DeleteJob>
#include
<KIO/DeleteJob>
#include
<KIO/JobUiDelegate>
#include
<KIO/JobUiDelegate>
#include
<KIO/OpenFileManagerWindowJob>
#include
<KIO/OpenFileManagerWindowJob>
#include
<KIO/OpenUrlJob>
#include
<kio_version.h>
#include
<kio_version.h>
// Permission strings
// Permission strings
...
@@ -535,7 +535,9 @@ void KFindTreeView::slotExecuteSelected()
...
@@ -535,7 +535,9 @@ void KFindTreeView::slotExecuteSelected()
if
(
index
.
column
()
==
0
)
{
if
(
index
.
column
()
==
0
)
{
KFindItem
item
=
m_model
->
itemAtIndex
(
index
);
KFindItem
item
=
m_model
->
itemAtIndex
(
index
);
if
(
item
.
isValid
())
{
if
(
item
.
isValid
())
{
new
KRun
(
item
.
getFileItem
().
targetUrl
(),
this
);
auto
*
job
=
new
KIO
::
OpenUrlJob
(
item
.
getFileItem
().
targetUrl
());
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
start
();
}
}
}
}
}
}
...
@@ -543,7 +545,7 @@ void KFindTreeView::slotExecuteSelected()
...
@@ -543,7 +545,7 @@ void KFindTreeView::slotExecuteSelected()
void
KFindTreeView
::
slotExecute
(
const
QModelIndex
&
index
)
void
KFindTreeView
::
slotExecute
(
const
QModelIndex
&
index
)
{
{
if
((
m_mouseButtons
&
Qt
::
LeftButton
)
&&
QApplication
::
keyboardModifiers
()
==
Qt
::
NoModifier
)
{
if
((
m_mouseButtons
&
Qt
::
LeftButton
)
&&
QApplication
::
keyboardModifiers
()
==
Qt
::
NoModifier
)
{
if
(
!
index
.
isValid
())
{
if
(
!
index
.
isValid
())
{
return
;
return
;
}
}
...
@@ -553,9 +555,11 @@ void KFindTreeView::slotExecute(const QModelIndex &index)
...
@@ -553,9 +555,11 @@ void KFindTreeView::slotExecute(const QModelIndex &index)
return
;
return
;
}
}
KFindItem
item
=
m_model
->
itemAtIndex
(
realIndex
);
const
KFindItem
item
=
m_model
->
itemAtIndex
(
realIndex
);
if
(
item
.
isValid
())
{
if
(
item
.
isValid
())
{
new
KRun
(
item
.
getFileItem
().
targetUrl
(),
this
);
auto
*
job
=
new
KIO
::
OpenUrlJob
(
item
.
getFileItem
().
targetUrl
());
job
->
setUiDelegate
(
new
KIO
::
JobUiDelegate
(
KJobUiDelegate
::
AutoHandlingEnabled
,
this
));
job
->
start
();
}
}
}
}
}
}
...
...
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