diff options
| author | Semih Yavuz <semih.yavuz@qt.io> | 2025-01-23 11:22:06 +0100 |
|---|---|---|
| committer | Semih Yavuz <semih.yavuz@qt.io> | 2025-01-29 20:37:42 +0100 |
| commit | df13ff9749afd883ca1740f2564ec646816bd8b4 (patch) | |
| tree | d3e546df9a75f585995aadb782b9aad7a88913e9 /tools/qmlformat/qmlformat.cpp | |
| parent | 4bda8065f9e801120350c3602f85192836424746 (diff) | |
qmlformat: remove non-existing data from buildCommandlineOptions
We no longer have Options{} data structure. Use QQmlFormatOptions
instead.
Pick-to: 6.8 6.9
Task-number: QTBUG-133225
Change-Id: I0a3625a4e41948c4fd010a52d71b8c5fb352ba82
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Diffstat (limited to 'tools/qmlformat/qmlformat.cpp')
| -rw-r--r-- | tools/qmlformat/qmlformat.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/qmlformat/qmlformat.cpp b/tools/qmlformat/qmlformat.cpp index 275c17a4ea..9d60d17f66 100644 --- a/tools/qmlformat/qmlformat.cpp +++ b/tools/qmlformat/qmlformat.cpp @@ -122,6 +122,7 @@ static bool parseFile(const QString &filename, const QQmlFormatOptions &options) QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app) { + QQmlFormatOptions options; #if QT_CONFIG(commandlineparser) QCommandLineParser parser; parser.setApplicationDescription("Formats QML files according to the QML Coding Conventions."); @@ -189,7 +190,6 @@ QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app) parser.process(app); if (parser.isSet(writeDefaultsOption)) { - QQmlFormatOptions options; options.setWriteDefaultSettingsEnabled(true); return options; } @@ -197,7 +197,6 @@ QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app) bool indentWidthOkay = false; const int indentWidth = parser.value("indent-width").toInt(&indentWidthOkay); if (!indentWidthOkay) { - QQmlFormatOptions options; options.addError("Error: Invalid value passed to -w"); return options; } @@ -218,7 +217,6 @@ QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app) } } - QQmlFormatOptions options; options.setIsVerbose(parser.isSet("verbose")); options.setIsInplace(parser.isSet("inplace")); options.setForceEnabled(parser.isSet("force")); @@ -244,10 +242,8 @@ QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app) } options.setMaxColumnWidth(maxColumnWidth); } - return options; -#else - return Options {}; #endif + return options; } int main(int argc, char *argv[]) |
