Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
ed22e001
Commit
ed22e001
authored
Aug 19, 2009
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt4: prevent moving a node into itself
..or it magically eats itself up
parent
53cd4ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.cpp
+21
-14
No files found.
modules/gui/qt4/components/playlist/playlist_model.cpp
View file @
ed22e001
...
...
@@ -255,27 +255,34 @@ bool PLModel::dropMimeData( const QMimeData *data, Qt::DropAction action,
}
else
{
QList
<
int
>
id
s
;
QList
<
playlist_item_t
*>
item
s
;
while
(
!
stream
.
atEnd
()
)
{
int
id
;
stream
>>
id
;
ids
.
append
(
id
);
}
int
count
=
ids
.
size
();
playlist_item_t
*
items
[
count
];
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
playlist_item_t
*
item
=
playlist_ItemGetById
(
p_playlist
,
ids
[
i
]
);
if
(
!
item
)
playlist_item_t
*
item
=
playlist_ItemGetById
(
p_playlist
,
id
);
if
(
!
item
)
continue
;
/* better not try to move a node into itself: */
if
(
item
->
i_children
>
0
)
{
PL_UNLOCK
;
return
false
;
playlist_item_t
*
climber
=
p_parent
;
while
(
climber
)
{
if
(
climber
==
item
)
break
;
climber
=
climber
->
p_parent
;
}
if
(
climber
)
continue
;
}
items
[
i
]
=
item
;
items
.
append
(
item
);
}
int
count
=
items
.
size
();
if
(
count
)
{
playlist_item_t
*
pp_items
[
count
];
for
(
int
i
=
0
;
i
<
count
;
i
++
)
pp_items
[
i
]
=
items
[
i
];
playlist_TreeMoveMany
(
p_playlist
,
count
,
pp_items
,
p_parent
,
(
row
==
-
1
?
p_parent
->
i_children
:
row
)
);
}
playlist_TreeMoveMany
(
p_playlist
,
count
,
items
,
p_parent
,
(
row
==
-
1
?
p_parent
->
i_children
:
row
)
);
}
PL_UNLOCK
;
...
...
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