-R option deletes user preferences

• May 2, 2019 - 17:01
Reported version
3.0
Type
Functional
Frequency
Few
Severity
S2 - Critical
Reproducibility
Always
Status
closed
Regression
No
Workaround
Yes
Project

Version: 3.0.5

The documentation of the -R option indicates that one can use it to temporarily use factory settings, but keep the user settings.

However, this is not so. After I did…

musescore3 -R -o x.pdf somefile.mscx

… my user settings were destroyed (which I did not want, which is precisely why I used the -R option instead of the -F option).

In MuseScore 3, using factory settings for such a conversation is necessary because otherwise it applies the chosen user style to all files, instead of just at new score creation (which is a regression, even if it may be desired behaviour, or it may be a bug).


Comments

Create and use a default.mss

The code evaluateting the commandline options is:

      useFactorySettings = parser.isSet("F");
      deletePreferences = (useFactorySettings || parser.isSet("R"));

The code reseting is

      if (deletePreferences) {
            if (useFactorySettings)
                  QDir(dataPath).removeRecursively();
            QSettings settings;
            QFile::remove(settings.fileName() + ".lock"); //forcibly remove lock
            QFile::remove(settings.fileName());
            settings.clear();
            }

So -R removes only the musescore.ini file (and a lock to it), -F additionaly removes shortcuts, workspaces, translations, extensions, etc.

Maybe the -S option could get extended to apply the builtin default style, if no style file is given. Currently it exits with a usage message. Wonder what happens with -S /dev/zero, shpould work, loading ot a style file return false on error, but here that return value isn't checked for.

I’ve got a better workaround… use -c with a temporary directory.

Can’t set the audio samplerate to 48 kHz (from 44k100Hz), but, oh well…

Status active PR created

https://github.com/musescore/MuseScore/pull/5132

I only addressed -R because I don't see how the -o affects restoring factory settings. Here's what I did.

-R restores factory preferences, but retains user customizations like shortcuts and workspaces
-F restores all preferences and removed customizations.
Updated -h (-help) to clarify these options
Did nothing to change the behavior of Help->Revert to Factory Settings.

Title -R option (together with -o) deletes user preferences -R option deletes user preferences
Frequency Once Few

Updated title to show the actual issue. Updated frequency since this annoys at least 2 of us.

Fix version
3.3.0