juk: new playlists show all columns (bug 243449)

Γιώργος Κυλάφας (Giorgos Kylafas) gekylafas at gmail.com
Mon May 23 12:57:11 BST 2011


Hi all,

I noticed the following bug in JuK: whenever a new playlist is created
(e.g. "File->New->Empty Playlist", a DynamicPlaylist is created etc.),
all the available columns as shown instead of only those that the user
has selected. However, if I switch to an old playlist and back to the
new one, then both will show the selected visible columns correctly.

I believe this is what https://bugs.kde.org/show_bug.cgi?id=243449
describes as well.

After examination, I think that the problem is that when a new
Playlist is created, slotInitialize() (which adds all the columns to
the playlist) is called _after_ Playlist::SharedSettings::apply()
(which sets the visible and hidden columns) [1]. If a user switches
playlists, apply() is called again and the correct columns are shown.

I have found two ways to fix this, however I am not sure for either of them:

a. Explicitly call slotInitialize() in Playlist::setup(), instead of
using QTimer::singleShot(...).
This has the disadvantage that is goes against the documentation of
slotInitialize() which says:
"Handle the necessary tasks needed to create and setup the playlist
that don't need to happen in the ctor [...]"
Maybe we do not mind making slotInitialize() part of the ctor
processing, but I am not in a position to judge this.

b. Call Playlist::SharedSettings::apply() at the end of slotInitialize().
This has the disadvantages that apply() is called twice and that for a
brief moment all columns are visible, which looks bad UI-wise.

What do you think?


[1] The order of calls, as I observe it in my case, is:
PlaylistCollection::createPlaylist()
Playlist::setup()
PlaylistCollection::setupPlaylist()
PlaylistCollection::raise()
Playlist::showEvent()
Playlist::SharedSettings::apply()
Playlist::slotInitialize()

-- 
Γιώργος Κυλάφας (Giorgos Kylafas)
http://en.wikipedia.org/wiki/Posting_style#Inline_replying
_______________________________________________
kde-multimedia mailing list
kde-multimedia at kde.org
https://mail.kde.org/mailman/listinfo/kde-multimedia


More information about the kde-multimedia mailing list