From 95595db7d1ce1427d19bae4bafe11d8867ab3849 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 27 Jan 2022 10:10:08 +0100 Subject: [PATCH] Docker: Drop handling of critical pattern again Drop lately introduced handling of critical pattern and just drop the critical pattern instead for now. Brings back gdb when auto detecting debuggers. Amends 22dd26bc76d and 181e74ebc35. Change-Id: Icde46e9bfa82d5cf1252e46f1e0a84b638927473 Reviewed-by: hjk --- src/plugins/docker/dockerdevice.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index e97d64e3964..1de6430b9cc 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -1502,17 +1502,19 @@ void DockerDevice::iterateWithFind(const FilePath &filePath, const QString nameOption = (filters & QDir::CaseSensitive) ? QString{"-name"} : QString{"-iname"}; - QStringList criticalWildcards; if (!filter.nameFilters.isEmpty()) { const QRegularExpression oneChar("\\[.*?\\]"); - for (int i = 0, len = filter.nameFilters.size(); i < len; ++i) { - if (i > 0) + bool addedFirst = false; + for (const QString ¤t : filter.nameFilters) { + if (current.indexOf(oneChar) != -1) { + LOG("Skipped" << current << "due to presence of [] wildcard"); + continue; + } + + if (addedFirst) filterOptions << "-o"; - QString current = filter.nameFilters.at(i); - if (current.indexOf(oneChar) != -1) - criticalWildcards.append(current); - current.replace(oneChar, "?"); // BAD! but still better than nothing filterOptions << nameOption << current; + addedFirst = true; } } arguments << filterOptions; @@ -1529,17 +1531,6 @@ void DockerDevice::iterateWithFind(const FilePath &filePath, continue; const FilePath fp = FilePath::fromString(entry); - if (!criticalWildcards.isEmpty() && - !Utils::anyOf(criticalWildcards, - [name = fp.fileName()](const QString &pattern) { - const QRegularExpression regex(QRegularExpression::wildcardToRegularExpression(pattern)); - if (regex.match(name).hasMatch()) - return true; - return false; - })) { - continue; - } - if (!callBack(fp.onDevice(filePath))) break; }