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
38054333
Commit
38054333
authored
Oct 02, 2022
by
Kai Uwe Broulik
🍇
Browse files
DolphinTabBar: Open folder in new tab when dropped onto tab bar
parent
8402b989
Pipeline
#242926
passed with stage
in 14 minutes and 19 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/dolphintabbar.cpp
View file @
38054333
...
...
@@ -36,13 +36,7 @@ void DolphinTabBar::dragEnterEvent(QDragEnterEvent* event)
const
int
index
=
tabAt
(
event
->
pos
());
if
(
mimeData
->
hasUrls
())
{
if
(
index
>=
0
)
{
event
->
acceptProposedAction
();
}
else
{
event
->
setDropAction
(
Qt
::
IgnoreAction
);
// Still need to accept it to receive dragMoveEvent
event
->
accept
();
}
event
->
acceptProposedAction
();
updateAutoActivationTimer
(
index
);
}
...
...
@@ -62,11 +56,6 @@ void DolphinTabBar::dragMoveEvent(QDragMoveEvent* event)
const
int
index
=
tabAt
(
event
->
pos
());
if
(
mimeData
->
hasUrls
())
{
if
(
index
>=
0
)
{
event
->
acceptProposedAction
();
}
else
{
event
->
setDropAction
(
Qt
::
IgnoreAction
);
}
updateAutoActivationTimer
(
index
);
}
...
...
@@ -81,7 +70,7 @@ void DolphinTabBar::dropEvent(QDropEvent* event)
const
QMimeData
*
mimeData
=
event
->
mimeData
();
const
int
index
=
tabAt
(
event
->
pos
());
if
(
index
>=
0
&&
mimeData
->
hasUrls
())
{
if
(
mimeData
->
hasUrls
())
{
Q_EMIT
tabDropEvent
(
index
,
event
);
}
...
...
src/dolphintabwidget.cpp
View file @
38054333
...
...
@@ -393,6 +393,17 @@ void DolphinTabWidget::tabDropEvent(int index, QDropEvent* event)
if
(
index
>=
0
)
{
DolphinView
*
view
=
tabPageAt
(
index
)
->
activeViewContainer
()
->
view
();
view
->
dropUrls
(
view
->
url
(),
event
,
view
);
}
else
{
const
auto
urls
=
event
->
mimeData
()
->
urls
();
for
(
const
QUrl
&
url
:
urls
)
{
auto
*
job
=
KIO
::
statDetails
(
url
,
KIO
::
StatJob
::
SourceSide
,
KIO
::
StatDetail
::
StatBasic
,
KIO
::
JobFlag
::
HideProgressInfo
);
connect
(
job
,
&
KJob
::
result
,
this
,
[
this
,
job
]()
{
if
(
!
job
->
error
()
&&
job
->
statResult
().
isDir
())
{
openNewTab
(
job
->
url
(),
QUrl
(),
NewTabPosition
::
AtEnd
);
}
});
}
}
}
...
...
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