Commit 1ffd6fa7 authored by Eugen Geist's avatar Eugen Geist Committed by Jean-Baptiste Kempf

Improved recognition of selected bookmarks for deletion.

Removed FIXME annotation and fixed the recognition of selected rows in
bookmarklist.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d6ca8ac6
......@@ -179,19 +179,18 @@ void BookmarksDialog::del()
input_thread_t *p_input = THEMIM->getInput();
if( !p_input ) return;
QModelIndexList selected = bookmarksList->selectionModel()->selectedIndexes();
QModelIndexList selected = bookmarksList->selectionModel()->selectedRows();
if ( !selected.empty() )
{
b_ignore_updates = true;
/* Sort needed to make sure that selected elements are deleted in descending
order, otherwise the indexes might change and wrong bookmarks are deleted. */
qSort( selected.begin(), selected.end() );
QModelIndexList::Iterator it = selected.end();
for( --it; it != selected.begin(); it-- )
{
/* FIXME: Find out why selectedIndexes() doesn't follow the
SelectRows selectionBehavior() and returns all columns */
if ( (*it).column() == 0 )
input_Control( p_input, INPUT_DEL_BOOKMARK, (*it).row() );
}
if ( (*it).column() == 0 )
input_Control( p_input, INPUT_DEL_BOOKMARK, (*it).row() );
b_ignore_updates = false;
update();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment