add command line option to forcing reuse of existing process for debugging

wilder
Martin T. H. Sandsmark 5 years ago committed by Tomaz Canabrava
parent 298a773460
commit 3e296ce245
  1. 5
      src/Application.cpp
  2. 4
      src/main.cpp

@ -72,7 +72,10 @@ void Application::populateCommandLineParser(QCommandLineParser *parser)
{{QStringLiteral("p")}, i18nc("@info:shell", "Change the value of a profile property."), QStringLiteral("property=value")},
{{QStringLiteral("e")},
i18nc("@info:shell", "Command to execute. This option will catch all following arguments, so use it as the last option."),
QStringLiteral("cmd")}};
QStringLiteral("cmd")},
{{QStringLiteral("force-reuse")}, i18nc("@info:shell", "Force re-using the existing instance even if it breaks functionality, e. g. --new-tab. Mostly for debugging.")},
};
for (const auto &option : options) {
parser->addOption(option);
}

@ -260,6 +260,10 @@ bool shouldUseNewProcess(int argc, char *argv[])
arguments.append(QString::fromLocal8Bit(argv[i]));
}
if (arguments.contains(QLatin1String("--force-reuse"))) {
return false;
}
// take Qt options into consideration
QStringList qtProblematicOptions;
qtProblematicOptions << QStringLiteral("--session") << QStringLiteral("--name") << QStringLiteral("--reverse") << QStringLiteral("--stylesheet")

Loading…
Cancel
Save