diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qmlformat/main.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/qmlformat/main.cpp b/tools/qmlformat/main.cpp index da3c1772fb..3f11ce257a 100644 --- a/tools/qmlformat/main.cpp +++ b/tools/qmlformat/main.cpp @@ -224,17 +224,19 @@ Options buildCommandLineOptions(const QCoreApplication &app) } QStringList files; - QFile file(parser.value("files")); - file.open(QIODevice::Text | QIODevice::ReadOnly); - if (file.isOpen()) { - QTextStream in(&file); - while (!in.atEnd()) { - QString file = in.readLine(); - - if (file.isEmpty()) - continue; - - files.push_back(file); + if (parser.isSet("files")) { + QFile file(parser.value("files")); + file.open(QIODevice::Text | QIODevice::ReadOnly); + if (file.isOpen()) { + QTextStream in(&file); + while (!in.atEnd()) { + QString file = in.readLine(); + + if (file.isEmpty()) + continue; + + files.push_back(file); + } } } |