From b44a7817b8dc3a7898ee6445d2c7494644b10797 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 19 Jul 2023 09:26:37 +0200 Subject: [PATCH 1/6] SquishTests: Handle codec problems Reading files depends on the system encoding and will return a bytes object instead of a str even for text files on some Windows setups. Handle this by explcitly converting to str if needed. Handle possible decoding issues by falling back to UTF8 encoding when running into decoding error while decoding on Windows. Change-Id: I8c1f24ff052710e4b1927399d54e321088e3b171 Reviewed-by: Marcus Tillmanns --- tests/system/shared/utils.py | 8 ++++++-- tests/system/suite_editors/tst_edit_externally/test.py | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 2a17e0333c2..8639c6e2651 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -611,8 +611,12 @@ def stringify(obj): if isinstance(obj, stringTypes): return obj if isinstance(obj, bytes): - tmp = obj.decode('cp1252') if platform.system() in ('Microsoft','Windows') else obj.decode() - return tmp + if not platform.system() in ('Microsoft', 'Windows'): + return obj.decode() + try: + return obj.decode('cp1252') + except UnicodeDecodeError: + return obj.decode('utf-8') class GitClone: diff --git a/tests/system/suite_editors/tst_edit_externally/test.py b/tests/system/suite_editors/tst_edit_externally/test.py index dea2f5d8ec6..e04ab19670a 100644 --- a/tests/system/suite_editors/tst_edit_externally/test.py +++ b/tests/system/suite_editors/tst_edit_externally/test.py @@ -39,7 +39,10 @@ def main(): test.fatal("Could not get the editor for '%s'" % currentFile, "Skipping this file for now.") continue + contentBefore = readFile(currentFile) + if not currentFile.endswith(".bin"): + contentBefore = stringify(contentBefore) if i % 2 == 0: # modify current file and store content for next modification formerContent = contentBefore From d53a743262aaf886f30ca67621896f5edb832d08 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 20 Jul 2023 07:22:24 +0200 Subject: [PATCH 2/6] SquishTests: Fix used short cut on macOS Modify used short cut on macOS again. This tends to break depending on OS version, underlying keyboard layout and maybe even more causes. Change-Id: I79b0e281128b8f779307782038aa9fb42510b633 Reviewed-by: Marcus Tillmanns --- tests/system/suite_HELP/tst_HELP02/test.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/system/suite_HELP/tst_HELP02/test.py b/tests/system/suite_HELP/tst_HELP02/test.py index e7e201c4948..8b6c32b7ded 100644 --- a/tests/system/suite_HELP/tst_HELP02/test.py +++ b/tests/system/suite_HELP/tst_HELP02/test.py @@ -3,6 +3,14 @@ source("../../shared/qtcreator.py") +if platform.system() == 'Darwin': + keysToType = '' + expectedKeys = 'Cmd+Opt+A' +else: + keysToType = '' + expectedKeys = 'Ctrl+Alt+A' + + # test Qt Creator version information from file and dialog def getQtCreatorVersionFromDialog(): chk = re.search("(?<=Qt Creator)\s\d+.\d+.\d+[-\w]*", @@ -68,17 +76,16 @@ def setKeyboardShortcutForAboutQtC(): "visible='1' text~='(Stop Recording|Record)'}" % shortcutGB) shortcut = ("{container=%s type='Utils::FancyLineEdit' unnamed='1' visible='1' " "placeholderText='Enter key sequence as text'}" % shortcutGB) - expected = 'Ctrl+Opt+A' if platform.system() == 'Darwin' else 'Ctrl+Alt+A' clickButton(record) - nativeType("") - waitFor("_shortcutMatches_(shortcut, expected)", 5000) + nativeType(keysToType) + waitFor("_shortcutMatches_(shortcut, expectedKeys)", 5000) clickButton(record) - gotExpectedShortcut = _shortcutMatches_(shortcut, expected) + gotExpectedShortcut = _shortcutMatches_(shortcut, expectedKeys) if not gotExpectedShortcut and platform.system() == 'Darwin': test.warning("Squish Issue: shortcut was set to %s - entering it manually now" % waitForObject(shortcut).text) - replaceEditorContent(shortcut, expected) + replaceEditorContent(shortcut, expectedKeys) else: test.verify(gotExpectedShortcut, "Expected key sequence is displayed.") clickButton(waitForObject(":Options.OK_QPushButton")) @@ -97,7 +104,7 @@ def main(): waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000) except: nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton) - nativeType("") + nativeType(keysToType) # verify qt creator version try: waitForObject(":About Qt Creator_Core::Internal::VersionDialog", 5000) From cd971160c3868bc13866ad709c27345b567eb229 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 20 Jul 2023 09:01:17 +0200 Subject: [PATCH 3/6] SquishTests: Adapt to different ui approach Using the window title property on macOS is not reliable as message boxes do not get any there. Use the expected text of the message box instead. Change-Id: I36dc865dcce6ba98643f0174887de12c197b3222 Reviewed-by: Marcus Tillmanns --- tests/system/objects.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/objects.map b/tests/system/objects.map index e69bd12677e..cc359d6b7fc 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -22,7 +22,7 @@ :Add Bookmark.treeView_QTreeView {type='QTreeView' unnamed='1' visible='1' window=':Add Bookmark_BookmarkDialog'} :Add Bookmark_BookmarkDialog {type='BookmarkDialog' unnamed='1' visible='1' windowTitle='Add Bookmark'} :Add to Version Control.No_QPushButton {text='No' type='QPushButton' unnamed='1' visible='1' window=':Add to Version Control_QMessageBox'} -:Add to Version Control_QMessageBox {type='QMessageBox' unnamed='1' visible='1' windowTitle='Add to Version Control'} +:Add to Version Control_QMessageBox {text~='Add the file\n.+\nto version control .+' type='QMessageBox' unnamed='1' visible='1'} :Analyzer Toolbar.AnalyzerManagerToolBox_QComboBox {container=':DebugModeWidget.Toolbar_QDockWidget' name='PerspectiveChooser' type='QComboBox' visible='1'} :Analyzer Toolbar.Clear_QToolButton {container=':DebugModeWidget.Toolbar_QDockWidget' toolTip='Discard data' type='QToolButton' unnamed='1' visible='1'} :Analyzer Toolbar.Elapsed:_QLabel {container=':DebugModeWidget.Toolbar_QDockWidget' text~='Elapsed: \\\\d+.\\\\d s' type='QLabel' unnamed='1' visible='1'} From 3da1adc442cb5674595e0fa3c3cdff7071d3444d Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 20 Jul 2023 10:31:07 +0200 Subject: [PATCH 4/6] sdktool: Fix writing files Fix an error when copying the file operations to sdktool. resolveSymlinks was (basically) always returning an empty string. Instead it should return the first file path that is not a symlink. Amends bb4d9c92e77f44b55f06a8b8080b5f35d363a1f5 Change-Id: Id6bfcc3332c14f074ab635e11ca0536b5326dbb1 Reviewed-by: hjk --- src/tools/sdktool/sdkpersistentsettings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/sdktool/sdkpersistentsettings.cpp b/src/tools/sdktool/sdkpersistentsettings.cpp index 34b139e2324..7fda2d8d03c 100644 --- a/src/tools/sdktool/sdkpersistentsettings.cpp +++ b/src/tools/sdktool/sdkpersistentsettings.cpp @@ -130,7 +130,7 @@ static QString resolveSymlinks(QString current) while (links--) { const QFileInfo info(current); if (!info.isSymLink()) - return {}; + return current; current = info.symLinkTarget(); } return current; From a76f8cf4dc4abd97a68893a2b6bd08bc6c56b932 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 20 Jul 2023 08:54:40 +0200 Subject: [PATCH 5/6] Doc: Change Extending Qt Creator Manual \page to index.html It was extending-index.html to solve some issues that were caused when generating the manuals from the same sources, but those seem to have been solved. The name index.html was already used at doc.qt.io for version 10.0. Change-Id: I16c11d286107141f49cf28824cef998bd233d975 Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot --- doc/qtcreatordev/src/qtcreator-dev.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/qtcreatordev/src/qtcreator-dev.qdoc b/doc/qtcreatordev/src/qtcreator-dev.qdoc index 5e11b9e7b44..554d5dbb19a 100644 --- a/doc/qtcreatordev/src/qtcreator-dev.qdoc +++ b/doc/qtcreatordev/src/qtcreator-dev.qdoc @@ -1,8 +1,8 @@ -// Copyright (C) 2020 The Qt Company Ltd. +// Copyright (C) 2023 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! - \page extending-index.html + \page index.html \title Extending Qt Creator Manual \QC is a cross-platform integrated development environment (IDE) tailored to From 6603c247d65c9e983f412480b6698684db93bc26 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Thu, 20 Jul 2023 11:24:05 +0200 Subject: [PATCH 6/6] Doc: Fix reference to an image whose format changed to WEBP Change-Id: I123af115096b17fdbe500af37f25704a45ad78a1 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/find/ifindfilter.cpp | 2 +- src/plugins/coreplugin/find/searchresultwindow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/find/ifindfilter.cpp b/src/plugins/coreplugin/find/ifindfilter.cpp index 85b8a68be80..66b7710586c 100644 --- a/src/plugins/coreplugin/find/ifindfilter.cpp +++ b/src/plugins/coreplugin/find/ifindfilter.cpp @@ -36,7 +36,7 @@ A common way to present the search results to the user, is to use the shared \uicontrol{Search Results} pane. - \image qtcreator-searchresults.png + \image qtcreator-search-results.webp {Search Results view} If you want to implement a find filter that is doing a file based text search, you should use \l Core::BaseTextFind, which already implements all diff --git a/src/plugins/coreplugin/find/searchresultwindow.cpp b/src/plugins/coreplugin/find/searchresultwindow.cpp index e2a83a71a0e..a096f452490 100644 --- a/src/plugins/coreplugin/find/searchresultwindow.cpp +++ b/src/plugins/coreplugin/find/searchresultwindow.cpp @@ -319,7 +319,7 @@ using namespace Core::Internal; \brief The SearchResultWindow class is the implementation of a commonly shared \uicontrol{Search Results} output pane. - \image qtcreator-searchresults.png + \image qtcreator-search-results.webp {Search Results view} Whenever you want to show the user a list of search results, or want to present UI for a global search and replace, use the single instance