cd import preferences doesn't save quality change and ogg quality problem

Bug #593371 reported by Rocco Aliberti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Exaile
Fix Released
Medium
Unassigned

Bug Description

exaile rev 3386:

There are 3 problems:
1) Every time you load the CD preferences panel, the quality combo is designed to load defalut values for the active format in the format combo.
2) The quality change are not saved in settings.ini, because was bypassed the method that calls the apply.
3) The Ogg quality raw_step is a float but when it's appended to the combo model it became an int.

My solution to the first 2 points above:
1) Load the default quality value for the active format just when it (the format) is different from the oldvalue.
2) Keep that ovveride, but connect the widget to the combo "changed" signal after the model is cleared, and to avoid the below traceback, which happens when each element of the model is deleted (calling model.clear() ) i disconnect it (if exists) before model.clear().

Traceback (most recent call last):
  File "/usr/lib64/exaile/xlgui/preferences/widgets.py", line 81, in change
    self.apply()
  File "/usr/lib64/exaile/xlgui/preferences/widgets.py", line 123, in apply
    value = self._get_value()
  File "/usr/lib64/exaile/xlgui/preferences/widgets.py", line 838, in _get_value
    return model.get_value(iter, 0)
TypeError: iter must be a GtkTreeIter

For the 3d point the solution would be to make int its raw_steps, but this then requires a migration of settings for older versions.

Related branches

Revision history for this message
reacocard (reacocard) wrote :

I get that traceback even with this patch.

I'm not sure i understand the 3rd issue, can you explain it more clearly?

Changed in exaile:
importance: Undecided → Medium
milestone: none → 0.3.2
status: New → Incomplete
Revision history for this message
Rocco Aliberti (eri.trabiccolo) wrote :

Maybe you get the traceback 'cause i uploaded the wrong patch, eheh, watch this:

if self._changed_id:
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ self.widget.disconnect(self._change_id)

(change|changed)_id. Sorry. Here the right patch.

For the third issue:
from xl.transcoder:

"Ogg Vorbis" : {
            "default" : 0.5,
            "raw_steps" : [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],

Raw_steps are float.
From plugins/cd/cdprefs.py:

steps = zip(formatinfo['raw_steps'], formatinfo['kbs_steps'])

        for item, title in steps:
            iter = model.append([item, title])

Here item is still a float, but when you get it the from the model you get an integer:

from xlgui/preferences/widgets.py:830:

def _get_value(self):
        """
            Value to be stored into the settings file
        """
        model = self.widget.get_model()
        iter = self.widget.get_active_iter()

        return model.get_value(iter, 0)

Thus for an Ogg Vorbis you save always:

[cd_import]
quality = I: 0
format = S: Ogg Vorbis

Revision history for this message
reacocard (reacocard) wrote :

patch committed trunk/3394. I also changed the model to use a gdouble instead of a gint for the first column, which should resolve the 3rd issue.

Changed in exaile:
status: Incomplete → Fix Committed
Revision history for this message
Rocco Aliberti (eri.trabiccolo) wrote :

Yes, works fine, thanks

reacocard (reacocard)
Changed in exaile:
status: Fix Committed → Fix Released
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.