diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-01-26 13:04:29 +0100 |
---|---|---|
committer | Andrei Golubev <andrei.golubev@qt.io> | 2022-02-02 21:54:38 +0100 |
commit | c0841771fe9775174fd386e3b1b1e88b5a29075d (patch) | |
tree | 12587d0f7d39df575b6f35d05a65f25027115465 /tools/qmltc/main.cpp | |
parent | 8a72c684464a48595337b01ada5605f612f7971e (diff) |
qmltc: remove --resource-path option
It does not seem to be necessary at all at the moment. Using the TP
status of the tool, we can eliminate it now. This could always be
reverted if users needed it, but so far --resource is enough
Change-Id: I39cd2cd854d99a6eee8f6dcf49ab904aad53c241
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools/qmltc/main.cpp')
-rw-r--r-- | tools/qmltc/main.cpp | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/tools/qmltc/main.cpp b/tools/qmltc/main.cpp index 8f78c0f30e..152a61fb24 100644 --- a/tools/qmltc/main.cpp +++ b/tools/qmltc/main.cpp @@ -84,14 +84,6 @@ int main(int argc, char **argv) QCoreApplication::translate("main", "h path") }; parser.addOption(outputHOption); - - QCommandLineOption resourcePathOption { - u"resource-path"_qs, - QCoreApplication::translate( - "main", "Qt resource file path corresponding to the file being compiled"), - QCoreApplication::translate("main", "resource path") - }; - parser.addOption(resourcePathOption); QCommandLineOption resourceOption { u"resource"_qs, QCoreApplication::translate( @@ -154,7 +146,7 @@ int main(int argc, char **argv) outputHFile = parser.value(outputHOption); } - if (!parser.isSet(resourceOption) && !parser.isSet(resourcePathOption)) { + if (!parser.isSet(resourceOption)) { fprintf(stderr, "No resource paths for file: %s\n", qPrintable(inputFile)); return EXIT_FAILURE; } @@ -174,28 +166,19 @@ int main(int argc, char **argv) // verify that we can map current file to qrc (then use the qrc path later) const QStringList paths = mapper.resourcePaths(QQmlJSResourceFileMapper::localFileFilter(url)); - QString resolvedResourcePath; - if (paths.size() != 1) { - if (parser.isSet(resourcePathOption)) { - qWarning("--resource-path option is deprecated. Prefer --resource along with " - "automatically generated resource file"); - resolvedResourcePath = parser.value(resourcePathOption); - } else if (paths.isEmpty()) { - fprintf(stderr, "Failed to find a resource path for file: %s\n", qPrintable(inputFile)); - return EXIT_FAILURE; - } else if (paths.size() > 1) { - fprintf(stderr, "Too many (expected 1) resource paths for file: %s\n", - qPrintable(inputFile)); - return EXIT_FAILURE; - } - } else { - resolvedResourcePath = paths.first(); + if (paths.isEmpty()) { + fprintf(stderr, "Failed to find a resource path for file: %s\n", qPrintable(inputFile)); + return EXIT_FAILURE; + } else if (paths.size() > 1) { + fprintf(stderr, "Too many (expected 1) resource paths for file: %s\n", + qPrintable(inputFile)); + return EXIT_FAILURE; } Options options; options.outputCppFile = parser.value(outputCppOption); options.outputHFile = parser.value(outputHOption); - options.resourcePath = resolvedResourcePath; + options.resourcePath = paths.first(); options.outNamespace = parser.value(namespaceOption); QQmlJSImporter importer { importPaths, &mapper }; |