From 9429f710da813205ffa0fc798fff0920f2c1161a Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 29 Sep 2022 14:12:53 +0200 Subject: [PATCH 1/4] QmlDesigner: Fix missing validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTCREATORBUG-28672 Change-Id: Ic8663d6c44cadbf3678ae564ec91572998d6d236 Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Tim Jenssen (cherry picked from commit 571d822c7b5d270a3017ffddb6b779dcac488d60) Reviewed-by: Robert Löhning Reviewed-by: Thomas Hartmann Reviewed-by: Eike Ziller --- src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index 725aec0e656..f68d5d07b43 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -2491,6 +2491,9 @@ bool NodeMetaInfo::isQmlComponent() const using namespace Storage::Info; return isBasedOnCommonType(m_projectStorage, m_typeId); } else { + if (!isValid()) + return false; + auto type = m_privateData->qualfiedTypeName(); return type == "Component" || type == "Qt.Component" || type == "QtQuick.Component" From d36ecb23dfeae01935a8331ddcf517356493b3e0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 27 Jan 2023 11:48:27 +0100 Subject: [PATCH 2/4] Update qbs submodule to HEAD of 1.24 branch Change-Id: I5c6a67335460bdc8b45e3808ddff22d91cfe3671 Reviewed-by: Christian Stenger --- src/shared/qbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/qbs b/src/shared/qbs index 106316f632e..03b0537a79b 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 106316f632e9aa5673932ea78cbc6ed5b5fe19d0 +Subproject commit 03b0537a79b3050dc0e70b6f4086f513f9b87e6d From 598ffc3b1c8cddf2381861e8d6f71b9b2050e66b Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 19 Jan 2023 08:05:43 +0100 Subject: [PATCH 3/4] Utils: Fake root info When trying to open a FileDialog all roots were tested for existence. This is slow and might show ask-pass. Since "/" can be considered always valid, we create a fake entry for it and only test existence of remote paths if they are not a root path. In the future FilePath should get a "isRoot()" function so we don't just test for == "/". Remove the fileAccess from WebAssembly devices. Change-Id: I7a1a6e7d2025e9fd4428e4bd1d07cdbdb5680c8e Reviewed-by: Eike Ziller --- src/libs/utils/devicefileaccess.cpp | 13 +++++++++++++ src/libs/utils/fileutils.cpp | 14 +++++++++----- src/libs/utils/fsengine/fsengine_impl.cpp | 3 +++ src/plugins/webassembly/webassemblydevice.cpp | 1 + 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 517004f2732..9cc98a0d739 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -829,6 +829,19 @@ QByteArray UnixDeviceFileAccess::fileId(const FilePath &filePath) const FilePathInfo UnixDeviceFileAccess::filePathInfo(const FilePath &filePath) const { + if (filePath.path() == "/") // TODO: Add FilePath::isRoot() + { + const FilePathInfo r{4096, + FilePathInfo::FileFlags( + FilePathInfo::ReadOwnerPerm | FilePathInfo::WriteOwnerPerm + | FilePathInfo::ExeOwnerPerm | FilePathInfo::ReadGroupPerm + | FilePathInfo::ExeGroupPerm | FilePathInfo::ReadOtherPerm + | FilePathInfo::ExeOtherPerm | FilePathInfo::DirectoryType + | FilePathInfo::LocalDiskFlag | FilePathInfo::ExistsFlag), + QDateTime::currentDateTime()}; + + return r; + } const RunResult stat = runInShell({"stat", {"-L", "-c", "%f %Y %s", filePath.path()}, OsType::OsTypeLinux}); return FileUtils::filePathInfoFromTriple(QString::fromLatin1(stat.stdOut)); } diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index bfead072f98..196c115b176 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -415,26 +415,30 @@ FilePath qUrlToFilePath(const QUrl &url) QUrl filePathToQUrl(const FilePath &filePath) { - return QUrl::fromLocalFile(filePath.toFSPathString()); + return QUrl::fromLocalFile(filePath.toFSPathString()); } void prepareNonNativeDialog(QFileDialog &dialog) { + const auto isValidSideBarPath = [](const FilePath &fp) { + return !fp.needsDevice() || fp.hasFileAccess(); + }; + // Checking QFileDialog::itemDelegate() seems to be the only way to determine // whether the dialog is native or not. if (dialog.itemDelegate()) { FilePaths sideBarPaths; - // Check existing urls, remove paths that need a device and no longer exist. + // Check existing urls, remove paths that need a device and are no longer valid. for (const QUrl &url : dialog.sidebarUrls()) { FilePath path = qUrlToFilePath(url); - if (!path.needsDevice() || path.exists()) + if (isValidSideBarPath(path)) sideBarPaths.append(path); } - // Add all device roots that are not already in the sidebar and exist. + // Add all device roots that are not already in the sidebar and valid. for (const FilePath &path : FSEngine::registeredDeviceRoots()) { - if (!sideBarPaths.contains(path) && path.exists()) + if (!sideBarPaths.contains(path) && isValidSideBarPath(path)) sideBarPaths.append(path); } diff --git a/src/libs/utils/fsengine/fsengine_impl.cpp b/src/libs/utils/fsengine/fsengine_impl.cpp index e09bc94609e..bea25476198 100644 --- a/src/libs/utils/fsengine/fsengine_impl.cpp +++ b/src/libs/utils/fsengine/fsengine_impl.cpp @@ -44,6 +44,9 @@ bool FSEngineImpl::open(QIODevice::OpenMode openMode) createCacheData); bool exists = (data.filePathInfo.fileFlags & QAbstractFileEngine::ExistsFlag); + if (data.filePathInfo.fileFlags & QAbstractFileEngine::DirectoryType) + return false; + g_filePathInfoCache.invalidate(m_filePath); ensureStorage(); diff --git a/src/plugins/webassembly/webassemblydevice.cpp b/src/plugins/webassembly/webassemblydevice.cpp index 86611d6f91e..2169078df0b 100644 --- a/src/plugins/webassembly/webassemblydevice.cpp +++ b/src/plugins/webassembly/webassemblydevice.cpp @@ -23,6 +23,7 @@ WebAssemblyDevice::WebAssemblyDevice() setDeviceState(IDevice::DeviceStateUnknown); setMachineType(IDevice::Hardware); setOsType(OsTypeOther); + setFileAccess(nullptr); } IDevice::Ptr WebAssemblyDevice::create() From c22b4b35e1e8205a3106dd1c9c04af6a3ea8ab7c Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 15 Dec 2022 12:57:29 +0100 Subject: [PATCH 4/4] SquishTests: Redo open document from navigation view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For unknown reasons this does no more work on a couple of machines. Re-doing the original approach by explicitly expanding the tree as necessary up to the file we want to open. Change-Id: I329e18f3e2162e381e11fb6164a448ae67def606 Reviewed-by: Robert Löhning Reviewed-by: Christian Stenger --- tests/system/shared/editor_utils.py | 44 +++++++++++++++++++---------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 57a60fd6a97..af56ed6f8dc 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -374,24 +374,38 @@ def addBranchWildcardToRoot(rootNode): return rootNode[:pos] + " [[]*[]]" + rootNode[pos:] def openDocument(treeElement): + # split into tree elements + treePathElements = re.split(r"(?