diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/qml/main.cpp | 3 | ||||
| -rw-r--r-- | tools/shared/qqmltoolingsettings.cpp | 19 |
2 files changed, 17 insertions, 5 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 51d46ced53..992a6a0cf6 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -302,6 +302,9 @@ static void getAppFlags(int argc, char **argv) { #ifdef QT_GUI_LIB for (int i=0; i<argc; i++) { + if (strcmp(argv[i], "--")) + return; // After "--", arguments are interpreted as positional and not as options. + if (!strcmp(argv[i], "--apptype") || !strcmp(argv[i], "-a") || !strcmp(argv[i], "-apptype")) { applicationType = QmlApplicationTypeUnknown; if (i+1 < argc) { diff --git a/tools/shared/qqmltoolingsettings.cpp b/tools/shared/qqmltoolingsettings.cpp index d153f7daec..8a6a84df46 100644 --- a/tools/shared/qqmltoolingsettings.cpp +++ b/tools/shared/qqmltoolingsettings.cpp @@ -105,12 +105,21 @@ bool QQmlToolingSettings::search(const QString &path) break; } - if (const QString iniFile = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, u"%1.ini"_s.arg(m_toolName)); !iniFile.isEmpty()) { - if (read(iniFile)) { - for (const QString &dir : std::as_const(dirs)) - m_seenDirectories[dir] = iniFile; - return true; + // First try to locate settings file with the standard name + QString iniFile = + QStandardPaths::locate(QStandardPaths::GenericConfigLocation, settingsFileName); + // If not found, try alternate name format + if (iniFile.isEmpty()) { + iniFile = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, + u"%1.ini"_s.arg(m_toolName)); + } + + // If a valid settings file was found, read it and update directory cache + if (!iniFile.isEmpty() && read(iniFile)) { + for (const QString &dir : std::as_const(dirs)) { + m_seenDirectories[dir] = iniFile; } + return true; } // No INI file found anywhere, record the failure so we won't have to traverse the entire |
