[vlc-devel] [PATCH]Fixed a typo in Qt's playlist interface + attached new PATCH

Lukas Durfina lukas.durfina at gmail.com
Wed Apr 30 14:43:17 CEST 2008

> The error I come up with is:
> ASSERT: "logicalIndex >= 0" in file itemviews/qheaderview.cpp, line 1215
> and then, VLC closes.

this is exactly problem, if there wouldnt be
if( logicalIndex < 0 )
it would be probably OK.

>>  -1 was used to disable sorting at startup,
>>  so when you use 0, can you see that
>>  playlist is sorted by first column?
> The first column is empty, and there's no label. But it sorts the
> playlist, and I think it uses the tracks.

I think there is no label, because there is broken
another code.

>>  Have you any ideas how to disable
>>  this startup sorting?
> I'm not a Qt expert, but I just read through the Qt doc, and they say
> that from Qt 4.2, they use QVLCTreeView::setSortingEnabled(true) to
> activate sorting (and that its default value is false). I tried with
> setSortingEnabled(false) and -1 in sortByColumn, and it doesn't fix
> the bug.
> There's something more that I see. At line 65 of
> modules/gui/qt4/components/playlist/standardpanel.cpp, there is:
>     view->setSortingEnabled( true );
>     view->sortByColumn( -1, Qt::AscendingOrder );
>     view->setModel(model);
> Could the model be loaded before the sort is enabled? I tried, but i
> run into the same error. Even with that, it seems nice to load the
> playlist before sorting it :)

it doesnt matter, when you enable sorting
setModel() sorts model, if it was enabled, and
setSortingEnable(true) calls sort too.

I make a new patch. It is not nice code
and if you dont want to use it, I understand.

I looked at related part of Qt code again,
and didnt find any better solution.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-playlist-startup-sorting-fix.patch
Type: application/octet-stream
Size: 1985 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080430/8af42074/attachment.obj>

More information about the vlc-devel mailing list