Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix command line options --template-mode, -R and --revert-settings #3989

Merged
merged 2 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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