Skip to content

Commit

Permalink
Merge pull request #3989 from Jojo-Schmitz/commandline-options
Browse files Browse the repository at this point in the history
fix command line options `--template-mode`, `-R` and `--revert-settings`
  • Loading branch information
anatoly-os committed Oct 29, 2018
2 parents 1455fbc + 5e0c276 commit 64d3653
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libmscore/scorefile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ void Score::writeMovement(XmlWriter& xml, bool selectionOnly)
QMapIterator<QString, QString> i(_metaTags);
while (i.hasNext()) {
i.next();
// do not output "platform" and "creationDate" in test mode
if ((!MScore::testMode && !MScore::saveTemplateMode) || (i.key() != "platform" && i.key() != "creationDate"))
// do not output "platform" and "creationDate" in test and save template mode
if ((!MScore::testMode && !MScore::saveTemplateMode) || (i.key() != "platform" && i.key() != "creationDate"))
xml.tag(QString("metaTag name=\"%1\"").arg(i.key().toHtmlEscaped()), i.value());
}

Expand Down
11 changes: 6 additions & 5 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6516,14 +6516,14 @@ int main(int argc, char* av[])
parser.addOption(QCommandLineOption({"D", "monitor-resolution"}, "Specify monitor resolution", "DPI"));
parser.addOption(QCommandLineOption({"S", "style"}, "Load style file", "style"));
parser.addOption(QCommandLineOption({"p", "plugin"}, "Execute named plugin", "name"));
parser.addOption(QCommandLineOption( "template-mode", "Save template mode, no page size"));
parser.addOption(QCommandLineOption({"F", "factory-settings"}, "Use factory settings"));
parser.addOption(QCommandLineOption( "template-mode", "Save template mode, no page size")); // and no platform and creationDate tags
parser.addOption(QCommandLineOption({"F", "factory-settings"}, "Use factory settings")); // this includes -R, --revert-settimngs
parser.addOption(QCommandLineOption({"R", "revert-settings"}, "Revert to default preferences"));
parser.addOption(QCommandLineOption({"i", "load-icons"}, "Load icons from INSTALLPATH/icons"));
parser.addOption(QCommandLineOption({"j", "job"}, "Process a conversion job", "file"));
parser.addOption(QCommandLineOption({"e", "experimental"}, "Enable experimental features"));
parser.addOption(QCommandLineOption({"c", "config-folder"}, "Override configuration and settings folder", "dir"));
parser.addOption(QCommandLineOption({"t", "test-mode"}, "Set test mode flag for all files"));
parser.addOption(QCommandLineOption({"t", "test-mode"}, "Set test mode flag for all files")); // this includes --template-mode
parser.addOption(QCommandLineOption({"M", "midi-operations"}, "Specify MIDI import operations file", "file"));
parser.addOption(QCommandLineOption({"w", "no-webview"}, "No web view in start center"));
parser.addOption(QCommandLineOption({"P", "export-score-parts"}, "Used with '-o <file>.pdf', export score and parts"));
Expand Down Expand Up @@ -6697,7 +6697,8 @@ int main(int argc, char* av[])
dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);

if (deletePreferences) {
QDir(dataPath).removeRecursively();
if (useFactorySettings)
QDir(dataPath).removeRecursively();
QSettings settings;
QFile::remove(settings.fileName() + ".lock"); //forcibly remove lock
QFile::remove(settings.fileName());
Expand Down Expand Up @@ -6732,7 +6733,7 @@ int main(int argc, char* av[])

// initialize current page size from default printer
#ifndef QT_NO_PRINTER
if (!MScore::testMode) {
if (!MScore::testMode && !MScore::saveTemplateMode) {
QPrinter p;
if (p.isValid()) {
// qDebug("set paper size from default printer");
Expand Down

0 comments on commit 64d3653

Please sign in to comment.