Skip to content
Commit a800c1b3 authored by Michael Pyne's avatar Michael Pyne
Browse files

playlist: Don't rely on overridden column count during construction.

The LGTM code scanning site has coverage of JuK by virtue of its Github
mirror, and reported [1] that `Playlist` was calling a function that was
indirectly reliant on a virtual function (`columnOffset()`) that is
overridden by subclasses like `HistoryPlaylist`.

This is a bug since the C++ language specifies that a superclass
constructor will be statically bound to call its own version of a
virtual function (or an even higher superclass's), rather than whatever
the subclass reimplementation might ultimately be.

This is fixed by using the data we already have at the time of
construction to set aside the right number of columns and then just
holding onto the header labels generated rather than trying to
introspect later.

[1] https://lgtm.com/projects/g/KDE/juk?mode=list
parent 64b95b30
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