Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
683c41a5
Commit
683c41a5
authored
Aug 22, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #1768
parent
f01abf1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
20 deletions
+13
-20
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+4
-18
src/playlist/item.c
src/playlist/item.c
+9
-2
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
683c41a5
...
...
@@ -191,7 +191,8 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
}
for
(
i
=
0
;
i
<
p_parent
->
i_children
;
i
++
)
if
(
p_parent
->
pp_children
[
i
]
==
p_target
)
break
;
playlist_TreeMove
(
p_playlist
,
p_src
,
p_parent
,
i
);
// Move the item to the element after i
playlist_TreeMove
(
p_playlist
,
p_src
,
p_parent
,
i
+
1
);
newParentItem
=
parentItem
;
}
else
...
...
@@ -201,25 +202,10 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
i
=
0
;
newParentItem
=
targetItem
;
}
/* Remove from source */
PLItem
*
srcItem
=
FindById
(
rootItem
,
p_src
->
i_id
);
// We dropped on the source selector. Ask the dialog to forward
// to the main view
if
(
!
srcItem
)
{
emit
shouldRemove
(
p_src
->
i_id
);
}
else
srcItem
->
remove
(
srcItem
);
/* Display at new destination */
PLItem
*
newItem
=
new
PLItem
(
p_src
,
newParentItem
,
this
);
newParentItem
->
insertChild
(
newItem
,
i
,
true
);
UpdateTreeItem
(
p_src
,
newItem
,
true
);
if
(
p_src
->
i_children
!=
-
1
)
UpdateNodeChildren
(
newItem
);
PL_UNLOCK
;
}
/*TODO: That's not a good idea to rebuild the playlist */
rebuild
();
}
return
true
;
}
...
...
src/playlist/item.c
View file @
683c41a5
...
...
@@ -697,6 +697,13 @@ static int TreeMove( playlist_t *p_playlist, playlist_item_t *p_item,
}
REMOVE_ELEM
(
p_detach
->
pp_children
,
p_detach
->
i_children
,
j
);
/* If j < i_newpos, we are moving the element from the top to the
* down of the playlist. So when removing the element we change have
* to change the position as we loose one element
*/
if
(
j
<
i_newpos
)
i_newpos
--
;
/* Attach to new parent */
INSERT_ELEM
(
p_node
->
pp_children
,
p_node
->
i_children
,
i_newpos
,
p_item
);
p_item
->
p_parent
=
p_node
;
...
...
@@ -742,7 +749,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
p_playlist
->
p_root_onelevel
,
false
);
if
(
p_node_onelevel
&&
p_item_onelevel
)
TreeMove
(
p_playlist
,
p_item_onelevel
,
p_node_onelevel
,
0
);
TreeMove
(
p_playlist
,
p_item_onelevel
,
p_node_onelevel
,
i_newpos
);
}
{
playlist_item_t
*
p_node_category
;
...
...
@@ -756,7 +763,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
p_playlist
->
p_root_category
,
false
);
if
(
p_node_category
&&
p_item_category
)
TreeMove
(
p_playlist
,
p_item_category
,
p_node_category
,
0
);
TreeMove
(
p_playlist
,
p_item_category
,
p_node_category
,
i_newpos
);
}
i_ret
=
VLC_SUCCESS
;
}
...
...
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