Library column configuration always breaks when available columns change

Bug #1390130 reported by Owen Williams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Medium
Owen Williams

Bug Description

Whenever a new column is added to Mixxx (most recently, cover art), the saved library configuration gets broken. I think this is because the column layout is saved by raw column index number, and if the new column is inserted into the enum, all the index numbers are wrong. I end up with a bpm column where I had an Artist column, etc. I have to painstakingly delete the incorrect columns and reinsert the columns I wanted.

possible solutions:
* save config by using names, not indexes
* have two column enums -- one for a config number that is only ever appended, and one for the default ordering of the columns which can safely change.

This bites me on every upgrade so I am marking this as important for the next version.

Tags: library polish
Revision history for this message
Owen Williams (ywwg) wrote :

Examples of before and after upgrade to cover art. Total change in libary column layout.

Revision history for this message
Owen Williams (ywwg) wrote :

after

Max Linke (max-linke)
tags: added: library
Revision history for this message
Owen Williams (ywwg) wrote :

So this is Hard.

We save and restore the column layout using the built-in .saveState and .restoreState functions, which return opaque binary blobs and breaks if the *number* of columns changes. So just getting the column ordering isn't enough -- no matter what, if we restoreState with an upgraded version of mixxx, the columns will be all messed up because we added a new column. For the 1.11->1.12 upgrade, the best we can probably do is reset the header_state value and restore the default column layout.

See:
http://stackoverflow.com/questions/1163030/qt-qtableview-and-horizontalheader-restorestate

We should probably write our own column-saving serialization, like the one mentioned in that discussion (http://codepad.org/2gPIMPYU). This is annoying, but straightforward enough. When 1.12 starts up, it could ignore the old header_state value and load the default, and then from then on save using the new code. It would be nice if we could migrate from the old code, but this isn't possible without figuring out the binary blob's internals.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Not High priority as per the guidelines:
http://mixxx.org/wiki/doku.php/launchpad_bugs

Changed in mixxx:
importance: High → Medium
Revision history for this message
Owen Williams (ywwg) wrote :

Things learned:

* The blob just can't work across changes in the number of visible library columns.
* If we try to write our own header config solution it won't be perfect.

Here's my proposed solution:

* We develop a best-effort header config solution, and usually we only write the value.
* We continue to use the binary blob
* Whenever the database schema affects the number of possible visible library columns, we delete the header_state values and load from the best-effort config

That will preserve the perfect header saving for current versions of mixxx, and will allow some amount of user configuration across upgrades.

RJ Skerry-Ryan (rryan)
Changed in mixxx:
assignee: nobody → Owen Williams (ywwg)
status: New → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/7629

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.