From 85617f1369e2638d47c1b583650200bd4805ddb3 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 16 May 2024 15:31:37 +0200 Subject: [PATCH 1/7] Git: Avoid crash when reloading files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly reset the document when the document gets closed. Task-number: QTCREATORBUG-30824 Change-Id: I4fb3d6fd6041990e5b8b4f6b7c4fd9ebc62f5a4a Reviewed-by: Orgad Shaneh Reviewed-by: André Hartmann --- src/plugins/git/instantblame.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/git/instantblame.cpp b/src/plugins/git/instantblame.cpp index 5921518c347..f932c78698e 100644 --- a/src/plugins/git/instantblame.cpp +++ b/src/plugins/git/instantblame.cpp @@ -166,6 +166,13 @@ void InstantBlame::setup() connect(EditorManager::instance(), &EditorManager::currentEditorChanged, this, setupBlameForEditor); + connect(EditorManager::instance(), &EditorManager::documentClosed, + this, [this](IDocument *doc) { + if (m_document != doc) + return; + disconnect(m_documentChangedConn); + m_document = nullptr; + }); } // Porcelain format of git blame output From 94cfacab0013357d019955e4fbd23452f31f5167 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Tue, 14 May 2024 13:22:08 +0200 Subject: [PATCH 2/7] Doc: Add direct link to the Getting Started with Qt Creator course ...in Qt Academy. No login is required. Fixes: QTCREATORBUG-30805 Change-Id: Iec62319b8affe087149f084db4e2341d4f11e51b Reviewed-by: Reviewed-by: Jaishree Vyas --- .../src/overview/creator-only/creator-getting-started.qdoc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/qtcreator/src/overview/creator-only/creator-getting-started.qdoc b/doc/qtcreator/src/overview/creator-only/creator-getting-started.qdoc index b1531ae6857..e735c95adf0 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-getting-started.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-getting-started.qdoc @@ -14,8 +14,9 @@ \title Getting Started - To learn the basics of \QC, take the \e {Getting Started with Qt Creator} - course in \l{https://www.qt.io/courses/}{Qt Learning}. + To learn the basics of \QC, take the + \l{https://www.qt.io/academy/course-catalog#getting-started-with-qt-creator} + {Getting Started with Qt Creator} course in Qt Academy. For more information about installing \QC, see \l{Install \QC}. From 30d755ccb48e05f434064178d323cbf36ec90dce Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 21 May 2024 14:43:53 +0200 Subject: [PATCH 3/7] COIN: Respect the DisableTests feature setting COIN already skips running tests with this feature, but also build Qt Creator without test support. Change-Id: I10e8323466a4baf4cac7128efbdbd54b16bb8e2c Reviewed-by: Reviewed-by: Christian Kandeler Reviewed-by: David Schulz --- coin/instructions/build.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/coin/instructions/build.yaml b/coin/instructions/build.yaml index 1972965b512..6ec0fcf1711 100644 --- a/coin/instructions/build.yaml +++ b/coin/instructions/build.yaml @@ -2,6 +2,15 @@ type: Group instructions: - type: MakeDirectory directory: "{{.AgentWorkingDir}}/build/qt_temp" + - type: Group + instructions: + - type: EnvironmentVariable + variableName: QTC_TEST_OPTION + variableValue: "--with-tests" + enable_if: + condition: property + property: features + not_contains_value: DisableTests - type: Group instructions: @@ -26,7 +35,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python3 -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python3 -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --elfutils-path {{.AgentWorkingDir}}/build/qt_temp/elfutils --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang {{.Env.QTC_TEST_OPTION}} --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -60,7 +69,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python3 -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + command: "python3 -u {{.AgentWorkingDir}}/qt-creator/qt-creator/scripts/build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}/qt-creator/qt-creator --build {{.AgentWorkingDir}}/qt-creator/qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --llvm-path {{.AgentWorkingDir}}/build/qt_temp/libclang --keychain-unlock-script /Users/qt/unlock-keychain.sh {{.Env.QTC_TEST_OPTION}} --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." @@ -112,7 +121,7 @@ instructions: maxTimeBetweenOutput: 360 userMessageOnFailure: "Failed to extract LLVM package, check logs." - type: ExecuteCommand - command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang --with-tests --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON" + command: "python -u {{.AgentWorkingDir}}\\qt-creator\\qt-creator\\scripts\\build.py --build-type {{.Env.QTC_BUILD_TYPE}} --src {{.AgentWorkingDir}}\\qt-creator\\qt-creator --build {{.AgentWorkingDir}}\\qt-creator\\qt-creator_build --qt-path {{.AgentWorkingDir}}/build/qt_install_dir --python-path {{.AgentWorkingDir}}\\build\\qt_temp\\python --elfutils-path {{.AgentWorkingDir}}\\buid\\qt_temp\\elfutils --llvm-path {{.AgentWorkingDir}}\\build\\qt_temp\\libclang {{.Env.QTC_TEST_OPTION}} --no-zip --add-config=-DCMAKE_C_COMPILER_LAUNCHER=sccache --add-config=-DCMAKE_CXX_COMPILER_LAUNCHER=sccache --add-config=-DWITH_SCCACHE_SUPPORT=ON" maxTimeInSeconds: 36000 maxTimeBetweenOutput: 3600 userMessageOnFailure: "Failed to run build.py, check logs." From 4d98ffab574e13aa91bc604ad46581e7523b5efa Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 23 May 2024 13:06:51 +0200 Subject: [PATCH 4/7] Debugger: Fix displaying LLDB states Do not update states label with empty strings while debugging as this overrides real state information when performing additional actions like fetching variables, stack, and so on inside the debugger. Change-Id: Ic026644931c845b6f3fb5bb422acc6e36e4a4142 Reviewed-by: hjk --- src/plugins/debugger/lldb/lldbengine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index c6daabd863c..1a03487c335 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -407,9 +407,10 @@ void LldbEngine::handleResponse(const QString &response) const QString name = item.name(); if (name == "result") { QString msg = item["status"].data(); - if (!msg.isEmpty()) + if (!msg.isEmpty()) { msg[0] = msg.at(0).toUpper(); - showStatusMessage(msg); + showStatusMessage(msg); + } int token = item["token"].toInt(); showMessage(QString("%1^").arg(token), LogOutput); From 07b5c96194028ac98af90982d3c1042fa16a1988 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 17 May 2024 15:49:54 +0200 Subject: [PATCH 5/7] Doc: Fix more QDoc warnings Change-Id: Ic7f4170276aa40a32c9394c9fad0d920971bf873 Reviewed-by: Eike Ziller --- src/libs/utils/execmenu.cpp | 3 +- .../editormanager/editormanager.cpp | 6 +-- .../editormanager/ieditorfactory.cpp | 39 +++++++++++-------- src/plugins/coreplugin/icore.cpp | 2 - src/plugins/coreplugin/iversioncontrol.cpp | 2 +- .../progressmanager/progressmanager.cpp | 2 +- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/libs/utils/execmenu.cpp b/src/libs/utils/execmenu.cpp index 13d79152953..4e463bdd6fd 100644 --- a/src/libs/utils/execmenu.cpp +++ b/src/libs/utils/execmenu.cpp @@ -44,7 +44,8 @@ QAction *execMenuAtWidget(QMenu *menu, QWidget *widget) } /*! - Adds tool tips to the menu that show the actions tool tip when hovering over an entry. + Adds tool tips to the \a menu that show the action's tool tip when hovering + over an entry. */ void addToolTipsToMenu(QMenu *menu) { diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index bd9b2620670..ac6bd5c8f63 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -261,10 +261,10 @@ void EditorManagerPlaceHolder::showEvent(QShowEvent *) */ /*! - \fn void Core::EditorManager::editorCreated(Core::IEditor *editor, const QString &fileName) + \fn void Core::EditorManager::editorCreated(Core::IEditor *editor, const Utils::FilePath &filePath) - This signal is emitted after an \a editor was created for \a fileName, but - before it was opened in an editor view. + This signal is emitted after an \a editor was created for the file at + \a filePath, but before it was opened in an editor view. */ /*! \fn void Core::EditorManager::editorOpened(Core::IEditor *editor) diff --git a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp index 7528e12a85d..22aa24e7377 100644 --- a/src/plugins/coreplugin/editormanager/ieditorfactory.cpp +++ b/src/plugins/coreplugin/editormanager/ieditorfactory.cpp @@ -47,23 +47,23 @@ static void mimeTypeFactoryLookup(const Utils::MimeType &mimeType, \brief The IEditorFactory class creates suitable editors for documents according to their MIME type. - Whenever a user wants to edit or create a document, the EditorManager - scans all IEditorFactory instances for suitable editors. The selected - IEditorFactory is then asked to create an editor. + When a user wants to edit or create a document, the EditorManager + scans all IEditorFactory instances for suitable editors and selects one + to create an editor. Implementations should set the properties of the IEditorFactory subclass in their constructor with IEditorFactory::setId(), IEditorFactory::setDisplayName(), - IEditorFactory::setMimeTypes(), and setEditorCreator() + IEditorFactory::setMimeTypes(), and IEditorFactory::setEditorCreator(). IEditorFactory instances automatically register themselves in \QC in their constructor. - There are two varieties of editors: Internal and external. Internal editors - open within the main editing area of Qt Creator. An IEditorFactory defines - an internal editor by using the \c setEditorCreator function. External + There are two varieties of editors: internal and external. Internal editors + open within the main editing area of \QC. An IEditorFactory instance defines + an internal editor by using the setEditorCreator() function. External editors are external applications and are defined by using the - \c setEditorStarter function. They are accessible by the user using - the \uicontrol{Open With} dialog + setEditorStarter() function. The user can access them from the + \uicontrol{Open With} dialog. \sa Core::IEditor \sa Core::IDocument @@ -167,7 +167,7 @@ IEditorFactory *IEditorFactory::editorFactoryForId(const Utils::Id &id) /*! Returns all available internal and external editors for the \a mimeType in the - default order: Editor types ordered by MIME type hierarchy, internal editors + default order: editor types are ordered by MIME type hierarchy, internal editors first. */ const EditorFactories IEditorFactory::defaultEditorFactories(const MimeType &mimeType) @@ -283,9 +283,10 @@ IEditor *IEditorFactory::createEditor() const } /*! - Starts an external editor. + Opens the file at \a filePath in an external editor. - Uses the function set with setEditorStarter() to start the editor. + Returns \c true on success or \c false on failure with the error in + \a errorMessage. \sa setEditorStarter() */ @@ -299,7 +300,7 @@ bool IEditorFactory::startEditor(const FilePath &filePath, QString *errorMessage Sets the function that is used to create an editor instance in createEditor() to \a creator. - This is mutually exclusive with the use of setEditorStarter. + This is mutually exclusive with the use of setEditorStarter(). \sa createEditor() */ @@ -313,12 +314,16 @@ void IEditorFactory::setEditorCreator(const std::function &creator) } /*! - Opens the editor with \a fileName. Returns \c true on success or \c false - on failure along with the error in \a errorMessage. + \fn void Core::IEditorFactory::setEditorStarter(const std::function &starter); - This is mutually exclusive with the use of setEditorCreator. + Sets the function that is used to open a file for a given \c FilePath to + \a starter. + + The function should return \c true on success, or return \c false and set the + \c QString to an error message at failure. + + This is mutually exclusive with the use of setEditorCreator(). */ - void IEditorFactory::setEditorStarter(const std::function &starter) { QTC_CHECK(!m_starter); diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index 8a727494c2d..aaad8458546 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -570,8 +570,6 @@ bool ICore::showWarningWithOptions(const QString &title, const QString &text, If \a scope is \c QSettings::SystemScope, only the installation settings shipped with the current version of \QC will be read. This functionality exists for internal purposes only. - - \sa settingsDatabase() */ QtcSettings *ICore::settings(QSettings::Scope scope) { diff --git a/src/plugins/coreplugin/iversioncontrol.cpp b/src/plugins/coreplugin/iversioncontrol.cpp index f70e4be492e..3ff7de5bcdd 100644 --- a/src/plugins/coreplugin/iversioncontrol.cpp +++ b/src/plugins/coreplugin/iversioncontrol.cpp @@ -143,7 +143,7 @@ QString IVersionControl::refreshTopic(const FilePath &repository) it will be used. Otherwise it will be refreshed using the items provided by \c setTopicFileTracker() and \c setTopicRefresher(). - \sa setTopicFileTracker(), setTopicRefresher(). + \sa setTopicFileTracker(), setTopicRefresher() */ QString IVersionControl::vcsTopic(const FilePath &topLevel) diff --git a/src/plugins/coreplugin/progressmanager/progressmanager.cpp b/src/plugins/coreplugin/progressmanager/progressmanager.cpp index 5aee0ad266c..a3e17b0036c 100644 --- a/src/plugins/coreplugin/progressmanager/progressmanager.cpp +++ b/src/plugins/coreplugin/progressmanager/progressmanager.cpp @@ -768,7 +768,7 @@ FutureProgress *ProgressManager::addTask(const QFuture &future, const QStr Shows a progress indicator for task given by the QFutureInterface object \a futureInterface. The progress indicator shows the specified \a title along with the progress bar. - The progress indicator will increase monotonically with time, at \a expectedSeconds + The progress indicator will increase monotonically with time, at \a expectedDuration it will reach about 80%, and continue to increase with a decreasingly slower rate. The \a type of a task will specify a logical grouping with other From d2cb8f0ccb9b84dee2c737693e1a8348a571c986 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 24 May 2024 20:09:46 +0200 Subject: [PATCH 6/7] QtSingleApplication: Fix unreliable '-client' option QLockFile documention states: When protecting a resource over a long time, however, the application should always call setStaleLockTime(0ms) and then tryLock() with a short timeout. Without the 0ms stale lock time the new Qt Creator instance would think that the lockfile is stale and starts a new instance! Amends dd1c9d1b71861563abb3fd4be11dc0cc91223b99 Fixes: QTCREATORBUG-30624 Change-Id: I0c0166239242895e25c7bf05d59a371cd0295758 Reviewed-by: Friedemann Kleint --- src/shared/qtsingleapplication/qtlocalpeer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/qtsingleapplication/qtlocalpeer.cpp b/src/shared/qtsingleapplication/qtlocalpeer.cpp index 47dd3805bad..4bbdab4abaa 100644 --- a/src/shared/qtsingleapplication/qtlocalpeer.cpp +++ b/src/shared/qtsingleapplication/qtlocalpeer.cpp @@ -60,6 +60,7 @@ QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId) + QLatin1Char('/') + socketName + QLatin1String("-lockfile"); lockFile.reset(new QLockFile(lockName)); + lockFile->setStaleLockTime(0); } bool QtLocalPeer::isClient() From 7a4bbab6f7057ccd789dd1db0a84bfab7a27e301 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 27 May 2024 09:14:25 +0200 Subject: [PATCH 7/7] Terminal: Fix Environment Parsing entries like: "name=value=this" would drop the "value=" part from the environment variable. This patch fixes that. Fixes: QTCREATORBUG-30844 Change-Id: Ia50d4180bd8f966f61f92e550b046c8ece529e1b Reviewed-by: Cristian Adam --- src/libs/3rdparty/libptyqt/unixptyprocess.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/libs/3rdparty/libptyqt/unixptyprocess.cpp b/src/libs/3rdparty/libptyqt/unixptyprocess.cpp index e9ec1d590f6..d76349a49e2 100644 --- a/src/libs/3rdparty/libptyqt/unixptyprocess.cpp +++ b/src/libs/3rdparty/libptyqt/unixptyprocess.cpp @@ -190,16 +190,17 @@ bool UnixPtyProcess::startProcess(const QString &shellPath, m_readMasterNotify->disconnect(); }); - QStringList varNames; - for (const QString &line : std::as_const(environment)) - varNames.append(line.split("=").first()); - - QProcessEnvironment envFormat; - for (const QString &line : std::as_const(environment)) - envFormat.insert(line.split("=").first(), line.split("=").last()); + QProcessEnvironment env; + for (const QString &envEntry : environment) { + const int idx = envEntry.indexOf('='); + if (idx != -1) + env.insert(envEntry.left(idx), envEntry.mid(idx + 1)); + else + env.insert(envEntry, QString()); + } m_shellProcess.setWorkingDirectory(workingDir); - m_shellProcess.setProcessEnvironment(envFormat); + m_shellProcess.setProcessEnvironment(env); m_shellProcess.setReadChannel(QProcess::StandardOutput); m_shellProcess.start(m_shellPath, arguments); if (!m_shellProcess.waitForStarted())