windeployqt: allow user set translation directory
Add the "translationdir" option, which allows the user to choose a different directory to deploy the translation files. Pick-to: 6.5 6.4 Change-Id: Iacf2031abb6d992e6765c02f232f81317b784720 Reviewed-by: Timothée Keller <timothee.keller@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>bb10
parent
690761a4ad
commit
8902bc6356
|
|
@ -337,6 +337,12 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||
QStringLiteral("path"));
|
||||
parser->addOption(pluginDirOption);
|
||||
|
||||
const QCommandLineOption translationDirOption(
|
||||
u"translationdir"_s,
|
||||
u"Copy translations to path."_s,
|
||||
u"path"_s);
|
||||
parser->addOption(translationDirOption);
|
||||
|
||||
QCommandLineOption qmlDeployDirOption(QStringLiteral("qml-deploy-dir"),
|
||||
QStringLiteral("Copy qml files to path."),
|
||||
QStringLiteral("path"));
|
||||
|
|
@ -478,6 +484,7 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||
|
||||
options->libraryDirectory = parser->value(libDirOption);
|
||||
options->pluginDirectory = parser->value(pluginDirOption);
|
||||
options->translationsDirectory = parser->value(translationDirOption);
|
||||
options->qmlDirectory = parser->value(qmlDeployDirOption);
|
||||
options->plugins = !parser->isSet(noPluginsOption);
|
||||
options->libraries = !parser->isSet(noLibraryOption);
|
||||
|
|
@ -633,7 +640,8 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse
|
|||
}
|
||||
if (multipleDirs)
|
||||
std::wcerr << "Warning: using binaries from different directories\n";
|
||||
options->translationsDirectory = options->directory + "/translations"_L1;
|
||||
if (options->translationsDirectory.isEmpty())
|
||||
options->translationsDirectory = options->directory + "/translations"_L1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue