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
Multimedia
Amarok
Commits
42529bca
Commit
42529bca
authored
Apr 02, 2012
by
Bart Cerneels
Browse files
Improve activate (double click) handling, fix bug.
BUG:297092 FIXED-IN:2.6
parent
6eab9b94
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/browsers/playlistbrowser/PlaylistBrowserModel.cpp
View file @
42529bca
...
...
@@ -48,6 +48,7 @@ PlaylistBrowserModel::PlaylistBrowserModel( int playlistCategory )
//common, unconditional actions
m_appendAction
=
new
QAction
(
KIcon
(
"media-track-add-amarok"
),
i18n
(
"&Add to Playlist"
),
this
);
m_appendAction
->
setObjectName
(
"appendAction"
);
m_appendAction
->
setProperty
(
"popupdropper_svg_id"
,
"append"
);
connect
(
m_appendAction
,
SIGNAL
(
triggered
()
),
this
,
SLOT
(
slotAppend
()
)
);
...
...
@@ -55,6 +56,7 @@ PlaylistBrowserModel::PlaylistBrowserModel( int playlistCategory )
i18nc
(
"Replace the currently loaded tracks with these"
,
"&Replace Playlist"
),
this
);
m_loadAction
->
setObjectName
(
"loadAction"
);
m_loadAction
->
setProperty
(
"popupdropper_svg_id"
,
"load"
);
connect
(
m_loadAction
,
SIGNAL
(
triggered
()
),
this
,
SLOT
(
slotLoad
()
)
);
...
...
src/browsers/playlistbrowser/PlaylistBrowserView.cpp
View file @
42529bca
...
...
@@ -292,7 +292,7 @@ void PlaylistBrowserNS::PlaylistBrowserView::contextMenuEvent( QContextMenuEvent
menu
.
exec
(
mapToGlobal
(
event
->
pos
()
)
);
//We keep the items that the action
s
need to be applied to in the actions private data.
//We keep the items that the action need to be applied to in the action
'
s private data.
//Clear the data from all actions now that the context menu has executed.
foreach
(
QAction
*
action
,
actions
)
action
->
setData
(
QVariant
()
);
...
...
@@ -361,13 +361,16 @@ PlaylistBrowserNS::PlaylistBrowserView::slotActivated( const QModelIndex &idx )
QActionList
idxActions
=
model
()
->
data
(
idx
,
PlaylistBrowserNS
::
PlaylistBrowserModel
::
ActionRole
).
value
<
QActionList
>
();
//The first action is usually "Add to Playlist"
if
(
!
idxActions
.
isEmpty
()
)
{
idxActions
.
first
()
->
trigger
();
//always needs to be done after activation.
idxActions
.
first
()
->
setData
(
QVariant
()
);
}
//The first action is by convention "Add to Playlist" (see PlaylistBrowserModel)
Q_ASSERT
(
!
idxActions
.
isEmpty
());
QAction
*
appendAction
=
idxActions
.
first
();
Q_ASSERT
(
appendAction
->
objectName
()
==
"appendAction"
);
appendAction
->
trigger
();
//We keep the items that the action need to be applied to in the action's private data.
//Clear the data from all actions now that the context menu has executed.
foreach
(
QAction
*
action
,
idxActions
)
action
->
setData
(
QVariant
()
);
}
#include
"PlaylistBrowserView.moc"
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